konpeito 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d513cebc5d3b0574c814b92901fbe2f4154e4ffc905da31c095abf9375bcaf34
4
- data.tar.gz: 8becb035b3dc4e7aa9f2cb482fa658fcf4551ceeb734fba5c7727eb87e06babd
3
+ metadata.gz: 2d4e25daf950c4a2c5c60e4a646f4c0f74a959e1557761feb3327245ec995bee
4
+ data.tar.gz: f0e5571b58a2316a729c15872be3e0bfa9cba03573f96f51b79e4b384e2af675
5
5
  SHA512:
6
- metadata.gz: e37567409349ff5fe6c87802b89ffe2ecef3cd7b4b74fc332df6534e5c5e144b0d527d9f2d67d39c532dd117ebe35aa654e2779a4c10f6191f96b0a8fa9bb168
7
- data.tar.gz: aef79cd03516814b259747bf9eaa0b449d692ca6568b6ecf9c4939e05ce279d7343d65caf8ceccc74e63094839e318bf5a855ea8b2d75e54f83d6e1e7f5ef6e8
6
+ metadata.gz: 6c7fd35077041ff22737b3b72a101771f597ebe813a61fbc47b2c5bd29245afd4df77d60d1a0fef50005631fbed9932bb6d9599a9f5d50ed8f833a3691157a36
7
+ data.tar.gz: 539a02d11cebfc1ad35e0df912fa49043aa8f4cd310088ee5c2f419d6cd14c59a1ed5ec603fa7974fb947f95a6c42d390516f54849d727400707cb218a52484b
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to Konpeito will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.9.1] - 2026-03-16
9
+
10
+ ### Fixed
11
+ - **mruby standalone build without Clay** failed with linker error
12
+ (`_konpeito_clay_set_resize_frame_fn` undefined). Replaced extern reference
13
+ with function pointer registration pattern so Clay-free builds link cleanly.
14
+
8
15
  ## [0.9.0] - 2026-03-16
9
16
 
10
17
  ### Added
@@ -404,6 +411,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
404
411
  - `%a{extern}` - external C struct wrappers
405
412
  - `%a{simd}` - SIMD vectorization
406
413
 
414
+ [0.9.1]: https://github.com/i2y/konpeito/compare/v0.9.0...v0.9.1
407
415
  [0.9.0]: https://github.com/i2y/konpeito/compare/v0.8.0...v0.9.0
408
416
  [0.8.0]: https://github.com/i2y/konpeito/compare/v0.7.1...v0.8.0
409
417
  [0.7.1]: https://github.com/i2y/konpeito/compare/v0.7.0...v0.7.1
@@ -5211,11 +5211,7 @@ module Konpeito
5211
5211
  @builder.position_at_end(llvm_block)
5212
5212
  # Return the last value in the block, or Qnil
5213
5213
  # For while_exit blocks, the last instruction loads the break value
5214
- if last_instr
5215
- @builder.ret(last_instr)
5216
- else
5217
- @builder.ret(qnil)
5218
- end
5214
+ @builder.ret(last_instr || qnil)
5219
5215
  end
5220
5216
  end
5221
5217
 
@@ -1141,9 +1141,16 @@ mrb_value konpeito_mrb_top_self(mrb_state *mrb) { return mrb_top_self(mrb); }
1141
1141
  * Live resize bridge — calls Ruby _kui_resize_frame() from C
1142
1142
  * ================================================================ */
1143
1143
 
1144
- /* Forward declaration from clay_native.c */
1144
+ /* Forward declaration from clay_native.c — resolved via function pointer to avoid
1145
+ link errors when Clay is not linked */
1145
1146
  typedef void (*clay_frame_fn)(void);
1146
- extern void konpeito_clay_set_resize_frame_fn(clay_frame_fn fn);
1147
+ typedef void (*set_resize_fn_t)(clay_frame_fn);
1148
+
1149
+ static set_resize_fn_t konpeito_clay_set_resize_frame_fn_ptr = NULL;
1150
+
1151
+ void konpeito_set_clay_resize_fn(set_resize_fn_t fn) {
1152
+ konpeito_clay_set_resize_frame_fn_ptr = fn;
1153
+ }
1147
1154
 
1148
1155
  static void konpeito_resize_frame_bridge(void) {
1149
1156
  mrb_state *mrb = konpeito_mrb_state;
@@ -1157,5 +1164,7 @@ static void konpeito_resize_frame_bridge(void) {
1157
1164
  }
1158
1165
 
1159
1166
  void konpeito_register_resize_callback(void) {
1160
- konpeito_clay_set_resize_frame_fn(konpeito_resize_frame_bridge);
1167
+ if (konpeito_clay_set_resize_frame_fn_ptr) {
1168
+ konpeito_clay_set_resize_frame_fn_ptr(konpeito_resize_frame_bridge);
1169
+ }
1161
1170
  }
@@ -154,6 +154,11 @@ static void live_resize_refresh_callback(GLFWwindow *window);
154
154
  * Lifecycle
155
155
  * ═══════════════════════════════════════════ */
156
156
 
157
+ /* mruby_helpers.c exposes this so Clay can register its resize function */
158
+ typedef void (*set_resize_fn_t)(clay_frame_fn);
159
+ extern void konpeito_set_clay_resize_fn(set_resize_fn_t fn);
160
+ void konpeito_clay_set_resize_frame_fn(clay_frame_fn fn); /* defined below */
161
+
157
162
  void konpeito_clay_init(double w, double h) {
158
163
  uint32_t min_mem = Clay_MinMemorySize();
159
164
  g_arena = Clay_CreateArenaWithCapacityAndMemory(min_mem, malloc(min_mem));
@@ -174,6 +179,9 @@ void konpeito_clay_init(double w, double h) {
174
179
  glfwSetFramebufferSizeCallback(glfw_win, live_resize_framebuffer_callback);
175
180
  glfwSetWindowRefreshCallback(glfw_win, live_resize_refresh_callback);
176
181
  }
182
+
183
+ /* Register resize function pointer into mruby_helpers.c */
184
+ konpeito_set_clay_resize_fn(konpeito_clay_set_resize_frame_fn);
177
185
  }
178
186
 
179
187
  void konpeito_clay_destroy(void) {
@@ -101,6 +101,12 @@ static void clay_error_handler(Clay_ErrorData error) {
101
101
  * Lifecycle
102
102
  * ═══════════════════════════════════════════ */
103
103
 
104
+ /* mruby_helpers.c exposes this so ClayTUI can register its resize function */
105
+ typedef void (*clay_frame_fn_fwd)(void);
106
+ typedef void (*set_resize_fn_t)(clay_frame_fn_fwd);
107
+ extern void konpeito_set_clay_resize_fn(set_resize_fn_t fn);
108
+ static void konpeito_clay_set_resize_frame_fn(clay_frame_fn_fwd fn);
109
+
104
110
  void konpeito_clay_tui_init(double w, double h) {
105
111
  tb_init();
106
112
  tb_set_output_mode(TB_OUTPUT_TRUECOLOR);
@@ -110,6 +116,9 @@ void konpeito_clay_tui_init(double w, double h) {
110
116
  g_arena = Clay_CreateArenaWithCapacityAndMemory(min_mem, malloc(min_mem));
111
117
  g_ctx = Clay_Initialize(g_arena, (Clay_Dimensions){(float)w, (float)h},
112
118
  (Clay_ErrorHandler){ .errorHandlerFunction = clay_error_handler });
119
+
120
+ /* Register resize function pointer into mruby_helpers.c */
121
+ konpeito_set_clay_resize_fn(konpeito_clay_set_resize_frame_fn);
113
122
  }
114
123
 
115
124
  void konpeito_clay_tui_destroy(void) {
@@ -706,10 +715,10 @@ void konpeito_clay_tui_textbuf_set_str(int id, const char *str, int len) {
706
715
  g_textbuf_cursors[id] = len;
707
716
  }
708
717
 
709
- /* ── Stubs for GUI-only features (linked from mruby_helpers.c) ── */
718
+ /* ── Stubs for GUI-only features ── */
710
719
 
711
- typedef void (*clay_frame_fn)(void);
712
- void konpeito_clay_set_resize_frame_fn(clay_frame_fn fn) { (void)fn; }
713
720
  void konpeito_clay_set_bg_color(int r, int g, int b) { (void)r; (void)g; (void)b; }
714
721
  int konpeito_clay_is_resizing(void) { return 0; }
722
+ /* konpeito_clay_set_resize_frame_fn: no-op stub for TUI (forward-declared above) */
723
+ static void konpeito_clay_set_resize_frame_fn(clay_frame_fn_fwd fn) { (void)fn; }
715
724
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Konpeito
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konpeito
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasushi Itoh