summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-17 18:14:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-10-17 18:14:05 +0000
commit1b2d3f81ee00c3fc5f002aaf7a646ed08e605610 (patch)
treee0a3a8afd1fbda407b8e36749d4f84f7e1942c0a /pack.c
parentd51bcd20071f6f61bce0364c81fb48e2c5b7d224 (diff)
1.6.2 (to be)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pack.c b/pack.c
index ee63ffd35c..173c7d80ad 100644
--- a/pack.c
+++ b/pack.c
@@ -24,8 +24,8 @@
#ifdef NATINT_PACK
# define OFF16B(p) ((char*)(p) + (natint?0:(sizeof(short) - SIZE16)))
# define OFF32B(p) ((char*)(p) + (natint?0:(sizeof(long) - SIZE32)))
-# define NATINT_I32(x) (natint?sizeof(NUM2LONG(x)):(NUM2I32(x)))
-# define NATINT_U32(x) (natint?sizeof(NUM2ULONG(x)):(NUM2U32(x)))
+# define NATINT_I32(x) (natint?NUM2LONG(x):(NUM2I32(x)))
+# define NATINT_U32(x) (natint?NUM2ULONG(x):(NUM2U32(x)))
# define NATINT_LEN(type,len) (natint?sizeof(type):(len))
# ifdef WORDS_BIGENDIAN
# define OFF16(p) OFF16B(p)
@@ -38,12 +38,15 @@
#endif
#ifndef OFF16
-# define OFF16B(p) (char*)(p)
-# define OFF32B(p) (char*)(p)
# define OFF16(p) (char*)(p)
# define OFF32(p) (char*)(p)
#endif
+#ifndef OFF16B
+# define OFF16B(p) (char*)(p)
+# define OFF32B(p) (char*)(p)
+#endif
+
#define define_swapx(x, xtype) \
static xtype \
TOKEN_PASTE(swap,x)(z) \