1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/ruby.h: fix previous change for LP64.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-21 19:34:24 +00:00
parent 9ee7875162
commit ae0ca36f8b
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Fri Aug 22 04:33:56 2008 Tanaka Akira <akr@fsij.org>
* include/ruby/ruby.h: fix previous change for LP64.
Fri Aug 22 03:19:41 2008 Tanaka Akira <akr@fsij.org>
* include/ruby/ruby.h (NUM2LONG): make it inline function to evaluete

View file

@ -403,13 +403,13 @@ NUM2LONG(VALUE x)
#define NUM2ULONG(x) rb_num2ulong((VALUE)x)
#if SIZEOF_INT < SIZEOF_LONG
long rb_num2int(VALUE);
long rb_fix2int(VALUE);
#define FIX2INT(x) ((int)rb_fix2int((VALUE)x))
static inline int
NUM2INT(VALUE x)
{
return FIXNUM_P(x) ? FIX2INT(x) : rb_num2int(x);
}
long rb_fix2int(VALUE);
#define FIX2INT(x) ((int)rb_fix2int((VALUE)x))
unsigned long rb_num2uint(VALUE);
#define NUM2UINT(x) ((unsigned int)rb_num2uint(x))
unsigned long rb_fix2uint(VALUE);
@ -454,7 +454,9 @@ VALUE rb_int2big(SIGNED_VALUE);
static inline VALUE
INT2NUM(int v)
{
# if SIZEOF_VALUE <= SIZEOF_INT
if (FIXABLE(v)) return INT2FIX(v);
# endif
return rb_int2big(v);
}
static inline VALUE
@ -466,7 +468,9 @@ LONG2NUM(long v)
static inline VALUE
UINT2NUM(unsigned int v)
{
# if SIZEOF_VALUE <= SIZEOF_INT
if (POSFIXABLE(v)) return LONG2FIX(v);
# endif
return rb_uint2big(v);
}
static inline VALUE