* 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
This commit is contained in:
parent
d966f1b2f3
commit
755e09ebf1
@ -1,6 +1,13 @@
|
|||||||
|
Fri Apr 5 20:41:49 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Fri Apr 5 20:19:42 2013 Tanaka Akira <akr@fsij.org>
|
Fri Apr 5 20:19:42 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* addr2line.c: include ruby/missing.h to fix compile error on Debian.
|
* addr2line.c: Include ruby/missing.h to fix compile error on Debian.
|
||||||
|
|
||||||
Fri Apr 5 19:39:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Apr 5 19:39:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
@ -114,6 +114,10 @@ void xfree(void*);
|
|||||||
#define STRINGIZE0(expr) #expr
|
#define STRINGIZE0(expr) #expr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LONG_LONG 1
|
||||||
|
# define HAVE_TRUE_LONG_LONG 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SIZEOF_LONG_LONG > 0
|
#if SIZEOF_LONG_LONG > 0
|
||||||
# define LONG_LONG long long
|
# define LONG_LONG long long
|
||||||
#elif SIZEOF___INT64 > 0
|
#elif SIZEOF___INT64 > 0
|
||||||
|
12
pack.c
12
pack.c
@ -22,21 +22,21 @@
|
|||||||
(__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
|
(__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is intentional that the condition for natstr is HAVE_LONG_LONG
|
* It is intentional that the condition for natstr is HAVE_TRUE_LONG_LONG
|
||||||
* instead of LONG_LONG.
|
* instead of HAVE_LONG_LONG or LONG_LONG.
|
||||||
* This means q! and Q! means always the standard long long type and
|
* This means q! and Q! means always the standard long long type and
|
||||||
* causes ArgumentError for platforms which has no long long type,
|
* causes ArgumentError for platforms which has no long long type,
|
||||||
* even if the platform has an implementation specific 64bit type.
|
* even if the platform has an implementation specific 64bit type.
|
||||||
* This behavior is consistent with the document of pack/unpack.
|
* This behavior is consistent with the document of pack/unpack.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_LONG_LONG
|
#ifdef HAVE_TRUE_LONG_LONG
|
||||||
static const char natstr[] = "sSiIlLqQ";
|
static const char natstr[] = "sSiIlLqQ";
|
||||||
#else
|
#else
|
||||||
static const char natstr[] = "sSiIlL";
|
static const char natstr[] = "sSiIlL";
|
||||||
#endif
|
#endif
|
||||||
static const char endstr[] = "sSiIlLqQ";
|
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
|
# define NATINT_PACK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -68,8 +68,8 @@ static const char endstr[] = "sSiIlLqQ";
|
|||||||
# define NATINT_LEN(type,len) ((int)sizeof(type))
|
# define NATINT_LEN(type,len) ((int)sizeof(type))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LONG_LONG
|
#ifdef HAVE_TRUE_LONG_LONG
|
||||||
# define NATINT_LEN_Q NATINT_LEN(LONG_LONG, 8)
|
# define NATINT_LEN_Q NATINT_LEN(long long, 8)
|
||||||
#else
|
#else
|
||||||
# define NATINT_LEN_Q 8
|
# define NATINT_LEN_Q 8
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user