summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 19:34:24 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-21 19:34:24 +0000
commitae0ca36f8b6ccb767439d799f7260b980a04895b (patch)
tree41fbefb1a512883af2e46134a98dc85c9fd43402 /include/ruby/ruby.h
parent9ee7875162df5d55fcb56a36e39efa45894de6b3 (diff)
* 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
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index e1ecb229ac..00df85073d 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