aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.h
diff options
context:
space:
mode:
Diffstat (limited to 'ruby.h')
-rw-r--r--ruby.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/ruby.h b/ruby.h
index cf303f8e3c..e5b4a69697 100644
--- a/ruby.h
+++ b/ruby.h
@@ -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)