There ruby.hare many function macros defined as follows:
static inline int
#if defined(HAVE_PROTOTYPES)
rb_type(VALUE obj)
#else
rb_type(obj)
VALUE obj;
#endif
{
if (FIXNUM_P(obj)) return T_FIXNUM;
if (obj == Qnil) return T_NIL;
if (obj == Qfalse) return T_FALSE;
if (obj == Qtrue) return T_TRUE;
if (obj == Qundef) return T_UNDEF;
if (SYMBOL_P(obj)) return T_SYMBOL;
return BUILTIN_TYPE(obj);
}
If HAVE_PROTOTYPES==1, in my opinion, this function will look like this:
static inline int rb_type(VALUE obj)
{
...
}
However, if HAVE_PROPOTYPES==0, the definition of the function is as follows:
static inline int rb_type(VALUE obj)
VALUE obj;
{
...
}
I do not understand if this is grammatically correct. How should I understand that?
source
share