diff options
Diffstat (limited to 'ruby.h')
-rw-r--r-- | ruby.h | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -197,11 +197,10 @@ VALUE rb_ull2inum(unsigned LONG_LONG); #define IMMEDIATE_MASK 0x03 #define IMMEDIATE_P(x) ((VALUE)(x) & IMMEDIATE_MASK) -#define SYMBOL_P(x) (!SPECIAL_CONST_P(x) && RBASIC(x)->klass == rb_cSymbol) -VALUE rb_id2sym(ID); -ID rb_sym2id(VALUE); -#define ID2SYM(x) rb_id2sym(x) -#define SYM2ID(x) rb_sym2id(x) +#define SYMBOL_FLAG 0x0e +#define SYMBOL_P(x) (((VALUE)(x)&0xff)==SYMBOL_FLAG) +#define ID2SYM(x) ((VALUE)(((long)(x))<<8|SYMBOL_FLAG)) +#define SYM2ID(x) RSHIFT((unsigned long)x,8) /* special contants - i.e. non-zero and non-fixnum constants */ #define Qfalse ((VALUE)0) |