Skip to content

Commit e560660

Browse files
committed
Use #ifdef for all changes we have in headers
1 parent b20ef72 commit e560660

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

lib/cext/include/ruby/onigmo.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ int enc_is_unicode(const OnigEncodingType *enc);
331331
#define ONIGENC_IS_UNICODE(enc) ((enc)->flags & ONIGENC_FLAG_UNICODE)
332332
#endif
333333

334+
334335
#define ONIGENC_NAME(enc) ((enc)->name)
335336

336337
#ifdef TRUFFLERUBY

lib/cext/include/ruby/st.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ CONSTFUNC(st_index_t st_hash_end(st_index_t h));
143143
CONSTFUNC(st_index_t st_hash_start(st_index_t h));
144144
#define st_hash_start(h) ((st_index_t)(h))
145145

146+
#ifndef TRUFFLERUBY
147+
void rb_hash_bulk_insert_into_st_table(long, const VALUE *, VALUE);
148+
#endif
149+
146150
RUBY_SYMBOL_EXPORT_END
147151

148152
#if defined(__cplusplus)

lib/cext/include/ruby/subst.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
#undef snprintf
55
#undef vsnprintf
6+
#ifndef TRUFFLERUBY
7+
#define snprintf ruby_snprintf
8+
#endif
69

710
#define vsnprintf ruby_vsnprintf
811

lib/cext/include/ruby/thread.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@ extern "C" {
2323

2424
RUBY_SYMBOL_EXPORT_BEGIN
2525

26+
#ifdef TRUFFLERUBY
2627
void *rb_thread_call_with_gvl(gvl_call function, void *data1);
2728

28-
void *rb_thread_call_without_gvl(gvl_call function, void *data1, rb_unblock_function_t *unblock_function, void *data2);
29+
void *rb_thread_call_without_gvl(gvl_call function, void *data1,
30+
rb_unblock_function_t *unblock_function, void *data2);
2931
#define rb_thread_call_without_gvl2 rb_thread_call_without_gvl
32+
#else
33+
void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
34+
35+
void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
36+
rb_unblock_function_t *ubf, void *data2);
37+
void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
38+
rb_unblock_function_t *ubf, void *data2);
39+
#endif
3040

3141
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
3242
#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_

0 commit comments

Comments
 (0)