1 #ifndef RBIMPL_SPECIAL_CONSTS_H
2 #define RBIMPL_SPECIAL_CONSTS_H
42 #if defined(USE_FLONUM)
44 #elif SIZEOF_VALUE >= SIZEOF_DOUBLE
53 #define FIXNUM_P RB_FIXNUM_P
54 #define IMMEDIATE_P RB_IMMEDIATE_P
55 #define NIL_P RB_NIL_P
56 #define SPECIAL_CONST_P RB_SPECIAL_CONST_P
57 #define STATIC_SYM_P RB_STATIC_SYM_P
59 #define Qfalse RUBY_Qfalse
60 #define Qnil RUBY_Qnil
61 #define Qtrue RUBY_Qtrue
62 #define Qundef RUBY_Qundef
64 #define FIXNUM_FLAG RUBY_FIXNUM_FLAG
65 #define FLONUM_FLAG RUBY_FLONUM_FLAG
66 #define FLONUM_MASK RUBY_FLONUM_MASK
67 #define FLONUM_P RB_FLONUM_P
68 #define IMMEDIATE_MASK RUBY_IMMEDIATE_MASK
69 #define SYMBOL_FLAG RUBY_SYMBOL_FLAG
72 #define RB_FIXNUM_P RB_FIXNUM_P
73 #define RB_FLONUM_P RB_FLONUM_P
74 #define RB_IMMEDIATE_P RB_IMMEDIATE_P
75 #define RB_NIL_P RB_NIL_P
76 #define RB_SPECIAL_CONST_P RB_SPECIAL_CONST_P
77 #define RB_STATIC_SYM_P RB_STATIC_SYM_P
78 #define RB_TEST RB_TEST
79 #define RB_UNDEF_P RB_UNDEF_P
80 #define RB_NIL_OR_UNDEF_P RB_NIL_OR_UNDEF_P
87 #if defined(__DOXYGEN__)
231 return (obj & mask) == common_bits;
356 #define RUBY_Qfalse RBIMPL_CAST((VALUE)RUBY_Qfalse)
357 #define RUBY_Qtrue RBIMPL_CAST((VALUE)RUBY_Qtrue)
358 #define RUBY_Qnil RBIMPL_CAST((VALUE)RUBY_Qnil)
359 #define RUBY_Qundef RBIMPL_CAST((VALUE)RUBY_Qundef)
Defines RBIMPL_ATTR_ARTIFICIAL.
#define RBIMPL_ATTR_ARTIFICIAL()
Wraps (or simulates) __attribute__((artificial))
Defines RBIMPL_ATTR_CONST.
#define RBIMPL_ATTR_CONSTEXPR(_)
Wraps (or simulates) C++11 constexpr.
RBIMPL_ATTR_ENUM_EXTENSIBILITY.
#define RBIMPL_ATTR_ENUM_EXTENSIBILITY(_)
Wraps (or simulates) __attribute__((enum_extensibility))
RBIMPL_ATTR_CONST() int rb_io_oflags_fmode(int oflags)
Converts an oflags (that rb_io_modestr_oflags() returns) to a fmode (that rb_io_mode_flags() returns)...
#define inline
Old Visual Studio versions do not support the inline keyword, so we need to define it to be __inline.
static bool RB_STATIC_SYM_P(VALUE obj)
Checks if the given object is a static symbol.
static bool RB_TEST(VALUE obj)
Emulates Ruby's "if" statement.
static bool RB_FIXNUM_P(VALUE obj)
Checks if the given object is a so-called Fixnum.
static bool RB_IMMEDIATE_P(VALUE obj)
Checks if the given object is an immediate i.e.
static bool RB_NIL_OR_UNDEF_P(VALUE obj)
Checks if the given object is nil or undef.
static bool RB_SPECIAL_CONST_P(VALUE obj)
Checks if the given object is of enum ruby_special_consts.
static VALUE rb_special_const_p(VALUE obj)
Identical to RB_SPECIAL_CONST_P, except it returns a VALUE.
ruby_special_consts
special constants - i.e.
@ RUBY_SPECIAL_SHIFT
Least significant 8 bits are reserved.
@ RUBY_FIXNUM_FLAG
Flag to denote a fixnum.
@ RUBY_FLONUM_MASK
Bit mask detecting a flonum.
@ RUBY_FLONUM_FLAG
Flag to denote a flonum.
@ RUBY_Qundef
Represents so-called undef.
@ RUBY_SYMBOL_FLAG
Flag to denote a static symbol.
@ RUBY_IMMEDIATE_MASK
Bit mask detecting special consts.
static bool RB_NIL_P(VALUE obj)
Checks if the given object is nil.
static bool RB_UNDEF_P(VALUE obj)
Checks if the given object is undef.
static bool RB_FLONUM_P(VALUE obj)
Checks if the given object is a so-called Flonum.
#define RBIMPL_VALUE_FULL
Maximum possible value that a VALUE can take.
uintptr_t VALUE
Type that represents a Ruby object.