aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-09 03:25:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-09 03:25:20 +0000
commit7c036c7e3fcd82298d8e98aceaad2232697701d0 (patch)
treee2b4eeab60a0525fc1571c01433a59f2ab372bd9 /include
parent3f42963504d95783aa31e21ea04dc6beacbc45af (diff)
downloadruby-7c036c7e3fcd82298d8e98aceaad2232697701d0.tar.gz
ruby.h: add prefix
* include/ruby/ruby.h (RB_TEST, RB_NIL_P): prefix RB to get rid of name conflicts with other headers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/ruby.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 26fbd12e88..faccc2e896 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -441,8 +441,10 @@ enum ruby_special_consts {
#endif
#define SYMBOL_FLAG RUBY_SYMBOL_FLAG
-#define RTEST(v) !(((VALUE)(v) & ~RUBY_Qnil) == 0)
-#define NIL_P(v) !((VALUE)(v) != RUBY_Qnil)
+#define RB_TEST(v) !(((VALUE)(v) & ~RUBY_Qnil) == 0)
+#define RB_NIL_P(v) !((VALUE)(v) != RUBY_Qnil)
+#define RTEST(v) RB_TEST(v)
+#define NIL_P(v) RB_NIL_P(v)
#define CLASS_OF(v) rb_class_of((VALUE)(v))
@@ -1235,7 +1237,7 @@ int rb_big_sign(VALUE);
#define FL_USER18 RUBY_FL_USER18
#define FL_USER19 RUBY_FL_USER19
-#define RB_SPECIAL_CONST_P(x) (RB_IMMEDIATE_P(x) || !RTEST(x))
+#define RB_SPECIAL_CONST_P(x) (RB_IMMEDIATE_P(x) || !RB_TEST(x))
#define SPECIAL_CONST_P(x) RB_SPECIAL_CONST_P(x)
#define RB_FL_ABLE(x) (!RB_SPECIAL_CONST_P(x) && RB_BUILTIN_TYPE(x) != RUBY_T_NODE)
@@ -1474,7 +1476,7 @@ rb_obj_write(VALUE a, VALUE *slot, VALUE b, RB_UNUSED_VAR(const char *filename),
*slot = b;
#if USE_RGENGC
- rb_obj_written(a, Qundef /* ignore `oldv' now */, b, filename, line);
+ rb_obj_written(a, RUBY_Qundef /* ignore `oldv' now */, b, filename, line);
#endif
return a;
}
@@ -1945,7 +1947,7 @@ rb_class_of(VALUE obj)
if (obj == RUBY_Qtrue) return rb_cTrueClass;
if (RB_STATIC_SYM_P(obj)) return rb_cSymbol;
}
- else if (!RTEST(obj)) {
+ else if (!RB_TEST(obj)) {
if (obj == RUBY_Qnil) return rb_cNilClass;
if (obj == RUBY_Qfalse) return rb_cFalseClass;
}
@@ -1962,7 +1964,7 @@ rb_type(VALUE obj)
if (RB_STATIC_SYM_P(obj)) return RUBY_T_SYMBOL;
if (obj == RUBY_Qundef) return RUBY_T_UNDEF;
}
- else if (!RTEST(obj)) {
+ else if (!RB_TEST(obj)) {
if (obj == RUBY_Qnil) return RUBY_T_NIL;
if (obj == RUBY_Qfalse) return RUBY_T_FALSE;
}
@@ -2340,7 +2342,7 @@ rb_scan_args_set(int argc, const VALUE *argv,
if (f_hash && n_mand < argc) {
VALUE last = argv[argc - 1];
- if (NIL_P(last)) {
+ if (RB_NIL_P(last)) {
/* nil is taken as an empty option hash only if it is not
ambiguous; i.e. '*' is not specified and arguments are
given more than sufficient */
@@ -2349,7 +2351,7 @@ rb_scan_args_set(int argc, const VALUE *argv,
}
else {
hash = rb_check_hash_type(last);
- if (!NIL_P(hash)) {
+ if (!RB_NIL_P(hash)) {
VALUE opts = rb_extract_keywords(&hash);
if (!hash) argc--;
hash = opts ? opts : Qnil;