summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-05 11:44:56 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-05 11:44:56 (GMT)
commit755e09ebf1e020e8a3f329ba32d6bb7cabd0a8a4 (patch)
treef9f597a2ca1be265bab34a4016243cffef9fb9b3 /pack.c
parentd966f1b2f38c5f380f3a71d4ce698dac155a4bb8 (diff)
* include/ruby/defines.h (HAVE_TRUE_LONG_LONG): Defined to distinguish
availability of long long and availability of 64bit integer type. * pack.c: Use HAVE_TRUE_LONG_LONG to distinguish q! and Q! support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pack.c b/pack.c
index f5c0da5..6e9d254 100644
--- a/pack.c
+++ b/pack.c
@@ -22,21 +22,21 @@
(__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
/*
- * It is intentional that the condition for natstr is HAVE_LONG_LONG
- * instead of LONG_LONG.
+ * It is intentional that the condition for natstr is HAVE_TRUE_LONG_LONG
+ * instead of HAVE_LONG_LONG or LONG_LONG.
* This means q! and Q! means always the standard long long type and
* causes ArgumentError for platforms which has no long long type,
* even if the platform has an implementation specific 64bit type.
* This behavior is consistent with the document of pack/unpack.
*/
-#ifdef HAVE_LONG_LONG
+#ifdef HAVE_TRUE_LONG_LONG
static const char natstr[] = "sSiIlLqQ";
#else
static const char natstr[] = "sSiIlL";
#endif
static const char endstr[] = "sSiIlLqQ";
-#if SIZEOF_SHORT != 2 || SIZEOF_LONG != 4 || (defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG != 8)
+#if SIZEOF_SHORT != 2 || SIZEOF_LONG != 4 || (defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG != 8)
# define NATINT_PACK
#endif
@@ -68,8 +68,8 @@ static const char endstr[] = "sSiIlLqQ";
# define NATINT_LEN(type,len) ((int)sizeof(type))
#endif
-#ifdef HAVE_LONG_LONG
-# define NATINT_LEN_Q NATINT_LEN(LONG_LONG, 8)
+#ifdef HAVE_TRUE_LONG_LONG
+# define NATINT_LEN_Q NATINT_LEN(long long, 8)
#else
# define NATINT_LEN_Q 8
#endif