diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-21 19:34:24 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-21 19:34:24 +0000 |
| commit | 4ab42f453201e53964b74255931bfae177210da0 (patch) | |
| tree | 41fbefb1a512883af2e46134a98dc85c9fd43402 /include/ruby/ruby.h | |
| parent | 8d4776a12d2223393c303e65772232f62a400485 (diff) | |
| download | ruby-4ab42f453201e53964b74255931bfae177210da0.tar.gz ruby-4ab42f453201e53964b74255931bfae177210da0.tar.xz ruby-4ab42f453201e53964b74255931bfae177210da0.zip | |
* include/ruby/ruby.h: fix previous change for LP64.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
| -rw-r--r-- | include/ruby/ruby.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index e1ecb229a..00df85073 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -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 |
