File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -477,8 +477,16 @@ enum ruby_special_consts {
477
477
#endif
478
478
#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
479
479
480
+ #ifdef TRUFFLERUBY
481
+ #define RB_NIL_P (value ) ((int) polyglot_as_boolean(polyglot_invoke(RUBY_CEXT, "RB_NIL_P", value)))
480
482
int RTEST (VALUE value );
481
483
#define NIL_P (v ) RB_NIL_P(v)
484
+ #else
485
+ #define RB_TEST (v ) !(((VALUE)(v) & (VALUE)~RUBY_Qnil) == 0)
486
+ #define RB_NIL_P (v ) !((VALUE)(v) != RUBY_Qnil)
487
+ #define RTEST (v ) RB_TEST(v)
488
+ #define NIL_P (v ) RB_NIL_P(v)
489
+ #endif
482
490
483
491
#define CLASS_OF (v ) rb_class_of((VALUE)(v))
484
492
Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ extern VALUE (*rb_tr_wrap)(void *obj);
53
53
extern VALUE (* rb_tr_longwrap )(long obj );
54
54
55
55
56
- #define RB_NIL_P (value ) ((int)polyglot_as_boolean(polyglot_invoke(rb_tr_cext, "RB_NIL_P", value)))
57
-
58
56
#include <ruby/thread_native.h>
59
57
60
58
// Helpers
You can’t perform that action at this time.
0 commit comments