Skip to content

Commit 70531ba

Browse files
committed
[GR-26781] Reduce diff to Ruby 2.6
PullRequest: truffleruby/2126
2 parents 35d06c6 + e560660 commit 70531ba

File tree

16 files changed

+219
-142
lines changed

16 files changed

+219
-142
lines changed

lib/cext/include/ruby/encoding.h

Lines changed: 63 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,27 @@ enum ruby_encoding_consts {
4141
#define ENCODING_SHIFT RUBY_ENCODING_SHIFT
4242
#define ENCODING_MASK RUBY_ENCODING_MASK
4343

44+
#ifdef TRUFFLERUBY
4445
#define RB_ENCODING_SET_INLINED(obj,i) RB_ENCODING_SET(obj,i)
46+
#else
47+
#define RB_ENCODING_SET_INLINED(obj,i) do {\
48+
RBASIC(obj)->flags &= ~RUBY_ENCODING_MASK;\
49+
RBASIC(obj)->flags |= (VALUE)(i) << RUBY_ENCODING_SHIFT;\
50+
} while (0)
51+
#endif
4552
#define RB_ENCODING_SET(obj,i) rb_enc_set_index((obj), (i))
4653

54+
#ifdef TRUFFLERUBY
4755
#define RB_ENCODING_GET_INLINED(obj) RB_ENCODING_GET(obj)
4856
#define RB_ENCODING_GET(obj) rb_enc_get_index(obj)
57+
#else
58+
#define RB_ENCODING_GET_INLINED(obj) \
59+
(int)((RBASIC(obj)->flags & RUBY_ENCODING_MASK)>>RUBY_ENCODING_SHIFT)
60+
#define RB_ENCODING_GET(obj) \
61+
(RB_ENCODING_GET_INLINED(obj) != RUBY_ENCODING_INLINE_MAX ? \
62+
RB_ENCODING_GET_INLINED(obj) : \
63+
rb_enc_get_index(obj))
64+
#endif
4965

5066
#define RB_ENCODING_IS_ASCII8BIT(obj) (RB_ENCODING_GET_INLINED(obj) == 0)
5167

@@ -58,9 +74,18 @@ enum ruby_encoding_consts {
5874

5975
enum ruby_coderange_type {
6076
RUBY_ENC_CODERANGE_UNKNOWN = 0,
77+
#ifdef TRUFFLERUBY
6178
RUBY_ENC_CODERANGE_7BIT = 1,
6279
RUBY_ENC_CODERANGE_VALID = 2,
6380
RUBY_ENC_CODERANGE_BROKEN = 4
81+
#else
82+
RUBY_ENC_CODERANGE_7BIT = ((int)RUBY_FL_USER8),
83+
RUBY_ENC_CODERANGE_VALID = ((int)RUBY_FL_USER9),
84+
RUBY_ENC_CODERANGE_BROKEN = ((int)(RUBY_FL_USER8|RUBY_FL_USER9)),
85+
RUBY_ENC_CODERANGE_MASK = (RUBY_ENC_CODERANGE_7BIT|
86+
RUBY_ENC_CODERANGE_VALID|
87+
RUBY_ENC_CODERANGE_BROKEN)
88+
#endif
6489
};
6590

6691
static inline int
@@ -69,19 +94,24 @@ rb_enc_coderange_clean_p(int cr)
6994
return (cr ^ (cr >> 1)) & RUBY_ENC_CODERANGE_7BIT;
7095
}
7196
#define RB_ENC_CODERANGE_CLEAN_P(cr) rb_enc_coderange_clean_p(cr)
97+
#ifdef TRUFFLERUBY
7298
enum ruby_coderange_type RB_ENC_CODERANGE(VALUE obj);
99+
#else
100+
#define RB_ENC_CODERANGE(obj) ((int)RBASIC(obj)->flags & RUBY_ENC_CODERANGE_MASK)
101+
#endif
73102
#define RB_ENC_CODERANGE_ASCIIONLY(obj) (RB_ENC_CODERANGE(obj) == RUBY_ENC_CODERANGE_7BIT)
74103

75104
#ifdef TRUFFLERUBY
76105
void RB_ENC_CODERANGE_SET(VALUE obj, int cr);
106+
void rb_enc_coderange_clear(VALUE);
107+
#define RB_ENC_CODERANGE_CLEAR(obj) rb_enc_coderange_clear(obj)
77108
#else
78109
#define RB_ENC_CODERANGE_SET(obj,cr) (\
79110
RBASIC(obj)->flags = \
80111
(RBASIC(obj)->flags & ~RUBY_ENC_CODERANGE_MASK) | (cr))
112+
#define RB_ENC_CODERANGE_CLEAR(obj) RB_ENC_CODERANGE_SET((obj),0)
81113
#endif
82114

83-
#define RB_ENC_CODERANGE_CLEAR(obj) rb_enc_coderange_clear(obj)
84-
85115
/* assumed ASCII compatibility */
86116
#define RB_ENC_CODERANGE_AND(a, b) \
87117
((a) == RUBY_ENC_CODERANGE_7BIT ? (b) : \
@@ -176,8 +206,13 @@ rb_encoding *rb_enc_find(const char *name);
176206
#define rb_enc_name(enc) (enc)->name
177207

178208
/* rb_encoding * -> minlen/maxlen */
209+
#ifdef TRUFFLERUBY
179210
int rb_enc_mbminlen(rb_encoding *enc);
180211
int rb_enc_mbmaxlen(rb_encoding *enc);
212+
#else
213+
#define rb_enc_mbminlen(enc) (enc)->min_enc_len
214+
#define rb_enc_mbmaxlen(enc) (enc)->max_enc_len
215+
#endif
181216

182217
/* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */
183218
int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc);
@@ -187,11 +222,11 @@ int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc);
187222

188223
/* -> chlen, invalid or needmore */
189224
int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
190-
int MBCLEN_CHARFOUND_P(int r);
191-
int MBCLEN_CHARFOUND_LEN(int r);
225+
#define MBCLEN_CHARFOUND_P(ret) ONIGENC_MBCLEN_CHARFOUND_P(ret)
226+
#define MBCLEN_CHARFOUND_LEN(ret) ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
192227
#define MBCLEN_INVALID_P(ret) ONIGENC_MBCLEN_INVALID_P(ret)
193-
int MBCLEN_NEEDMORE_P(int r);
194-
int MBCLEN_NEEDMORE_LEN(int r);
228+
#define MBCLEN_NEEDMORE_P(ret) ONIGENC_MBCLEN_NEEDMORE_P(ret)
229+
#define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
195230

196231
/* -> 0x00..0x7f, -1 */
197232
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);
@@ -223,7 +258,11 @@ int rb_enc_code_to_mbclen(int code, rb_encoding *enc);
223258
/* start, ptr, end, encoding -> prev_char */
224259
#define rb_enc_prev_char(s,p,e,enc) ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
225260
/* start, ptr, end, encoding -> next_char */
261+
#ifdef TRUFFLERUBY
226262
char* rb_enc_left_char_head(char *start, char *p, char *end, rb_encoding *enc);
263+
#else
264+
#define rb_enc_left_char_head(s,p,e,enc) ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
265+
#endif
227266
#define rb_enc_right_char_head(s,p,e,enc) ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
228267
#define rb_enc_step_back(s,p,e,n,enc) ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
229268

@@ -251,7 +290,16 @@ int rb_enc_isspace(unsigned char c, rb_encoding *enc);
251290
#endif
252291
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
253292

293+
#ifdef TRUFFLERUBY
254294
int rb_enc_asciicompat(rb_encoding *enc);
295+
#else
296+
static inline int
297+
rb_enc_asciicompat_inline(rb_encoding *enc)
298+
{
299+
return rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc);
300+
}
301+
#define rb_enc_asciicompat(enc) rb_enc_asciicompat_inline(enc)
302+
#endif
255303

256304
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
257305
CONSTFUNC(int rb_enc_toupper(int c, rb_encoding *enc));
@@ -261,7 +309,6 @@ ID rb_interned_id_p(const char *, long, rb_encoding *);
261309
int rb_enc_symname_p(const char*, rb_encoding*);
262310
int rb_enc_symname2_p(const char*, long, rb_encoding*);
263311
int rb_enc_str_coderange(VALUE);
264-
void rb_enc_coderange_clear(VALUE);
265312
long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*);
266313
int rb_enc_str_asciionly_p(VALUE);
267314
#define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str))
@@ -303,8 +350,9 @@ VALUE rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc);
303350
RUBY_EXTERN VALUE rb_cEncoding;
304351

305352
/* econv stuff */
353+
#ifdef TRUFFLERUBY
306354
struct rb_econv_t {};
307-
355+
#endif
308356

309357
typedef enum {
310358
econv_invalid_byte_sequence,
@@ -401,24 +449,24 @@ enum ruby_econv_flag_type {
401449
#else
402450
0,
403451
#endif
404-
// #define ECONV_ERROR_HANDLER_MASK RUBY_ECONV_ERROR_HANDLER_MASK
452+
#define ECONV_ERROR_HANDLER_MASK RUBY_ECONV_ERROR_HANDLER_MASK
405453
#define ECONV_INVALID_MASK RUBY_ECONV_INVALID_MASK
406454
#define ECONV_INVALID_REPLACE RUBY_ECONV_INVALID_REPLACE
407455
#define ECONV_UNDEF_MASK RUBY_ECONV_UNDEF_MASK
408456
#define ECONV_UNDEF_REPLACE RUBY_ECONV_UNDEF_REPLACE
409457
#define ECONV_UNDEF_HEX_CHARREF RUBY_ECONV_UNDEF_HEX_CHARREF
410-
// #define ECONV_DECORATOR_MASK RUBY_ECONV_DECORATOR_MASK
411-
// #define ECONV_NEWLINE_DECORATOR_MASK RUBY_ECONV_NEWLINE_DECORATOR_MASK
412-
// #define ECONV_NEWLINE_DECORATOR_READ_MASK RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK
413-
// #define ECONV_NEWLINE_DECORATOR_WRITE_MASK RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK
458+
#define ECONV_DECORATOR_MASK RUBY_ECONV_DECORATOR_MASK
459+
#define ECONV_NEWLINE_DECORATOR_MASK RUBY_ECONV_NEWLINE_DECORATOR_MASK
460+
#define ECONV_NEWLINE_DECORATOR_READ_MASK RUBY_ECONV_NEWLINE_DECORATOR_READ_MASK
461+
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK RUBY_ECONV_NEWLINE_DECORATOR_WRITE_MASK
414462
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR RUBY_ECONV_UNIVERSAL_NEWLINE_DECORATOR
415463
#define ECONV_CRLF_NEWLINE_DECORATOR RUBY_ECONV_CRLF_NEWLINE_DECORATOR
416464
#define ECONV_CR_NEWLINE_DECORATOR RUBY_ECONV_CR_NEWLINE_DECORATOR
417465
#define ECONV_XML_TEXT_DECORATOR RUBY_ECONV_XML_TEXT_DECORATOR
418466
#define ECONV_XML_ATTR_CONTENT_DECORATOR RUBY_ECONV_XML_ATTR_CONTENT_DECORATOR
419-
// #define ECONV_STATEFUL_DECORATOR_MASK RUBY_ECONV_STATEFUL_DECORATOR_MASK
467+
#define ECONV_STATEFUL_DECORATOR_MASK RUBY_ECONV_STATEFUL_DECORATOR_MASK
420468
#define ECONV_XML_ATTR_QUOTE_DECORATOR RUBY_ECONV_XML_ATTR_QUOTE_DECORATOR
421-
// #define ECONV_DEFAULT_NEWLINE_DECORATOR RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR
469+
#define ECONV_DEFAULT_NEWLINE_DECORATOR RUBY_ECONV_DEFAULT_NEWLINE_DECORATOR
422470
/* end of flags for rb_econv_open */
423471

424472
/* flags for rb_econv_convert */

lib/cext/include/ruby/intern.h

Lines changed: 89 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ RUBY_SYMBOL_EXPORT_BEGIN
5353
#define UNLIMITED_ARGUMENTS (-1)
5454

5555
/* array.c */
56+
#ifdef TRUFFLERUBY
5657
void rb_mem_clear(VALUE*, long);
57-
#define rb_assoc_new(a, b) rb_ary_new3(2, a, b)
58+
#else
59+
void rb_mem_clear(register VALUE*, register long);
60+
#endif
61+
VALUE rb_assoc_new(VALUE, VALUE);
5862
VALUE rb_check_array_type(VALUE);
5963
VALUE rb_ary_new(void);
6064
VALUE rb_ary_new_capa(long capa);
@@ -63,12 +67,12 @@ VALUE rb_ary_new_from_values(long n, const VALUE *elts);
6367
VALUE rb_ary_tmp_new(long);
6468
void rb_ary_free(VALUE);
6569
void rb_ary_modify(VALUE);
66-
#define rb_ary_freeze(array) rb_obj_freeze(array)
70+
VALUE rb_ary_freeze(VALUE);
6771
VALUE rb_ary_shared_with_p(VALUE, VALUE);
6872
VALUE rb_ary_aref(int, const VALUE*, VALUE);
6973
VALUE rb_ary_subseq(VALUE, long, long);
7074
void rb_ary_store(VALUE, long, VALUE);
71-
#define rb_ary_dup(array) rb_obj_dup(array)
75+
VALUE rb_ary_dup(VALUE);
7276
VALUE rb_ary_resurrect(VALUE ary);
7377
VALUE rb_ary_to_ary(VALUE);
7478
VALUE rb_ary_to_s(VALUE);
@@ -291,6 +295,25 @@ void rb_check_trusted(VALUE);
291295
} \
292296
} while (0)
293297
#define rb_check_trusted_internal(obj) ((void) 0)
298+
#ifndef TRUFFLERUBY
299+
#ifdef __GNUC__
300+
#define rb_check_frozen(obj) __extension__({rb_check_frozen_internal(obj);})
301+
#define rb_check_trusted(obj) __extension__({rb_check_trusted_internal(obj);})
302+
#else
303+
static inline void
304+
rb_check_frozen_inline(VALUE obj)
305+
{
306+
rb_check_frozen_internal(obj);
307+
}
308+
#define rb_check_frozen(obj) rb_check_frozen_inline(obj)
309+
static inline void
310+
rb_check_trusted_inline(VALUE obj)
311+
{
312+
rb_check_trusted_internal(obj);
313+
}
314+
#define rb_check_trusted(obj) rb_check_trusted_inline(obj)
315+
#endif
316+
#endif
294317
void rb_check_copyable(VALUE obj, VALUE orig);
295318

296319
#define RB_OBJ_INIT_COPY(obj, orig) \
@@ -302,8 +325,14 @@ int rb_sourceline(void);
302325
const char *rb_sourcefile(void);
303326
VALUE rb_check_funcall(VALUE, ID, int, const VALUE*);
304327

305-
NORETURN(void rb_error_arity(int, int, int));
306-
int rb_check_arity(int argc, int min, int max);
328+
NORETURN(MJIT_STATIC void rb_error_arity(int, int, int));
329+
static inline int
330+
rb_check_arity(int argc, int min, int max)
331+
{
332+
if ((argc < min) || (max != UNLIMITED_ARGUMENTS && argc > max))
333+
rb_error_arity(argc, min, max);
334+
return argc;
335+
}
307336
#define rb_check_arity rb_check_arity /* for ifdef */
308337

309338
#if defined(NFDBITS) && defined(HAVE_RB_FD_INIT)
@@ -509,7 +538,7 @@ void rb_hash_foreach(VALUE, int (*)(ANYARGS), VALUE);
509538
VALUE rb_hash(VALUE);
510539
VALUE rb_hash_new(void);
511540
VALUE rb_hash_dup(VALUE);
512-
#define rb_hash_freeze(array) rb_obj_freeze(array)
541+
VALUE rb_hash_freeze(VALUE);
513542
VALUE rb_hash_aref(VALUE, VALUE);
514543
VALUE rb_hash_lookup(VALUE, VALUE);
515544
VALUE rb_hash_lookup2(VALUE, VALUE, VALUE);
@@ -733,11 +762,11 @@ VALUE rb_str_buf_append(VALUE, VALUE);
733762
VALUE rb_str_buf_cat(VALUE, const char*, long);
734763
VALUE rb_str_buf_cat2(VALUE, const char*);
735764
VALUE rb_str_buf_cat_ascii(VALUE, const char*);
736-
VALUE rb_obj_as_string(VALUE object);
765+
VALUE rb_obj_as_string(VALUE);
737766
VALUE rb_check_string_type(VALUE);
738767
void rb_must_asciicompat(VALUE);
739-
#define rb_str_dup(string) rb_obj_dup(string)
740-
#define rb_str_resurrect(string) rb_obj_dup(string)
768+
VALUE rb_str_dup(VALUE);
769+
VALUE rb_str_resurrect(VALUE str);
741770
VALUE rb_str_locktmp(VALUE);
742771
VALUE rb_str_unlocktmp(VALUE);
743772
VALUE rb_str_dup_frozen(VALUE);
@@ -750,7 +779,7 @@ VALUE rb_str_subseq(VALUE, long, long);
750779
char *rb_str_subpos(VALUE, long, long*);
751780
void rb_str_modify(VALUE);
752781
void rb_str_modify_expand(VALUE, long);
753-
#define rb_str_freeze(string) rb_obj_freeze(string)
782+
VALUE rb_str_freeze(VALUE);
754783
void rb_str_set_len(VALUE, long);
755784
VALUE rb_str_resize(VALUE, long);
756785
VALUE rb_str_cat(VALUE, const char*, long);
@@ -774,7 +803,7 @@ VALUE rb_str_equal(VALUE str1, VALUE str2);
774803
VALUE rb_str_drop_bytes(VALUE, long);
775804
void rb_str_update(VALUE, long, long, VALUE);
776805
VALUE rb_str_replace(VALUE, VALUE);
777-
#define rb_str_inspect(string) rb_inspect(string)
806+
VALUE rb_str_inspect(VALUE);
778807
VALUE rb_str_dump(VALUE);
779808
VALUE rb_str_split(VALUE, const char*);
780809
void rb_str_setter(VALUE, ID, VALUE*);
@@ -789,23 +818,70 @@ VALUE rb_str_scrub(VALUE, VALUE);
789818
/* symbol.c */
790819
VALUE rb_sym_all_symbols(void);
791820

821+
#ifndef TRUFFLERUBY
792822
#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
793-
VALUE rb_str_new_cstr(const char *string);
823+
#define rb_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
824+
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
825+
rb_str_new_static((str), (len)) : \
826+
rb_str_new((str), (len)) \
827+
)
828+
#define rb_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
829+
(__builtin_constant_p(str)) ? \
830+
rb_str_new_static((str), (long)strlen(str)) : \
831+
rb_str_new_cstr(str) \
832+
)
833+
#define rb_usascii_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
834+
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
835+
rb_usascii_str_new_static((str), (len)) : \
836+
rb_usascii_str_new((str), (len)) \
837+
)
794838
#define rb_utf8_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
795839
(__builtin_constant_p(str) && __builtin_constant_p(len)) ? \
796840
rb_utf8_str_new_static((str), (len)) : \
797841
rb_utf8_str_new((str), (len)) \
798842
)
843+
#define rb_tainted_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
844+
(__builtin_constant_p(str)) ? \
845+
rb_tainted_str_new((str), (long)strlen(str)) : \
846+
rb_tainted_str_new_cstr(str) \
847+
)
848+
#define rb_usascii_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
849+
(__builtin_constant_p(str)) ? \
850+
rb_usascii_str_new_static((str), (long)strlen(str)) : \
851+
rb_usascii_str_new_cstr(str) \
852+
)
799853
#define rb_utf8_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
800854
(__builtin_constant_p(str)) ? \
801855
rb_utf8_str_new_static((str), (long)strlen(str)) : \
802856
rb_utf8_str_new_cstr(str) \
803857
)
858+
#define rb_external_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
859+
(__builtin_constant_p(str)) ? \
860+
rb_external_str_new((str), (long)strlen(str)) : \
861+
rb_external_str_new_cstr(str) \
862+
)
863+
#define rb_locale_str_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
864+
(__builtin_constant_p(str)) ? \
865+
rb_locale_str_new((str), (long)strlen(str)) : \
866+
rb_locale_str_new_cstr(str) \
867+
)
868+
#define rb_str_buf_new_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
869+
(__builtin_constant_p(str)) ? \
870+
rb_str_buf_cat(rb_str_buf_new((long)strlen(str)), \
871+
(str), (long)strlen(str)) : \
872+
rb_str_buf_new_cstr(str) \
873+
)
804874
#define rb_str_cat_cstr(str, ptr) RB_GNUC_EXTENSION_BLOCK( \
805875
(__builtin_constant_p(ptr)) ? \
806876
rb_str_cat((str), (ptr), (long)strlen(ptr)) : \
807877
rb_str_cat_cstr((str), (ptr)) \
808878
)
879+
#define rb_exc_new_cstr(klass, ptr) RB_GNUC_EXTENSION_BLOCK( \
880+
(__builtin_constant_p(ptr)) ? \
881+
rb_exc_new((klass), (ptr), (long)strlen(ptr)) : \
882+
rb_exc_new_cstr((klass), (ptr)) \
883+
)
884+
#endif
809885
#endif
810886
#define rb_str_new2 rb_str_new_cstr
811887
#define rb_str_new3 rb_str_new_shared
@@ -814,6 +890,7 @@ VALUE rb_str_new_cstr(const char *string);
814890
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
815891
#define rb_str_buf_new2 rb_str_buf_new_cstr
816892
#define rb_usascii_str_new2 rb_usascii_str_new_cstr
893+
#define rb_str_buf_cat rb_str_cat
817894
#define rb_str_buf_cat2 rb_str_cat_cstr
818895
#define rb_str_cat2 rb_str_cat_cstr
819896
#define rb_strlen_lit(str) (sizeof(str "") - 1)

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)

0 commit comments

Comments
 (0)