Skip to content

Commit f6b7b9e

Browse files
committed
Fix building debase gem's native extension
It fails with the following error: ``` ... .rbenv/versions/truffleruby-23.0.0-preview1/lib/gems/gems/debase-ruby_core_source-0.10.18/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/array.h:106:1: error: static declaration of 'RARRAY_AREF' follows non-static declaration RARRAY_AREF(VALUE ary, long i) ^ ... .rbenv/versions/truffleruby-23.0.0-preview1/lib/cext/include/ruby/internal/core/rarray.h:263:7: note: previous declaration is here VALUE RARRAY_AREF(VALUE array, long index); ^ ```
1 parent 260d07b commit f6b7b9e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/cext/ABI_check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2
1+
3

lib/cext/include/ruby/internal/core/rarray.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ long rb_array_len(VALUE a);
279279
int RARRAY_LENINT(VALUE ary);
280280
VALUE *RARRAY_PTR_IMPL(VALUE array);
281281
void rb_ary_store(VALUE, long, VALUE);
282-
VALUE RARRAY_AREF(VALUE array, long index);
282+
VALUE rb_tr_rarray_aref(VALUE array, long index);
283283
#endif
284284
RBIMPL_SYMBOL_EXPORT_END()
285285

@@ -611,7 +611,7 @@ RARRAY_ASET(VALUE ary, long i, VALUE v)
611611
* transition path, but currently no way is found to do so.
612612
*/
613613
#ifdef TRUFFLERUBY
614-
#define RARRAY_AREF RARRAY_AREF
614+
#define RARRAY_AREF rb_tr_rarray_aref
615615
#else
616616
#define RARRAY_AREF(a, i) RARRAY_CONST_PTR_TRANSIENT(a)[i]
617617
#endif

src/main/c/cext/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ int RARRAY_LENINT(VALUE array) {
2020
return polyglot_get_array_size(rb_tr_unwrap(array));
2121
}
2222

23-
VALUE RARRAY_AREF(VALUE array, long index) {
23+
VALUE rb_tr_rarray_aref(VALUE array, long index) {
2424
return rb_tr_wrap(polyglot_get_array_element(rb_tr_unwrap(array), (int) index));
2525
}
2626

0 commit comments

Comments
 (0)