fix type issues in stdint.h so underlying types of 64-bit types match ABI
authorRich Felker <dalias@aerifal.cx>
Fri, 5 Apr 2013 00:09:50 +0000 (20:09 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 5 Apr 2013 00:09:50 +0000 (20:09 -0400)
arch/arm/bits/alltypes.h.sh
arch/i386/bits/alltypes.h.sh
arch/microblaze/bits/alltypes.h.sh
arch/mips/bits/alltypes.h.sh
arch/powerpc/bits/alltypes.h.sh
arch/x86_64/bits/alltypes.h.sh
include/stdint.h

index abe782d994cb86ac9e4e12b4f83ee75385113304..c1db1a0c907a255d15cfaa64c5530cb8cc8ec80c 100755 (executable)
@@ -56,6 +56,9 @@ TYPEDEF uint64_t           uint_fast64_t;
 TYPEDEF long          intptr_t;
 TYPEDEF unsigned long uintptr_t;
 
+TYPEDEF long long          intmax_t;
+TYPEDEF unsigned long long uintmax_t;
+
 TYPEDEF float float_t;
 TYPEDEF double double_t;
 
index 579aa1afe0fe3d3f5d80620c032cf61844ab5a57..aec7373176ea3b74667ca3169315aa64d7474c3d 100755 (executable)
@@ -64,6 +64,9 @@ TYPEDEF uint64_t           uint_fast64_t;
 TYPEDEF long          intptr_t;
 TYPEDEF unsigned long uintptr_t;
 
+TYPEDEF long long          intmax_t;
+TYPEDEF unsigned long long uintmax_t;
+
 #if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0
 TYPEDEF float float_t;
 TYPEDEF double double_t;
index 6ddd0823c5b046d1c7c31cbbc35a7582b24fee60..23f12d8e1a1c6e9a2ac6bdd507a95c6494ee67e3 100755 (executable)
@@ -56,6 +56,9 @@ TYPEDEF uint64_t           uint_fast64_t;
 TYPEDEF long          intptr_t;
 TYPEDEF unsigned long uintptr_t;
 
+TYPEDEF long long          intmax_t;
+TYPEDEF unsigned long long uintmax_t;
+
 TYPEDEF float float_t;
 TYPEDEF double double_t;
 
index 6ddd0823c5b046d1c7c31cbbc35a7582b24fee60..23f12d8e1a1c6e9a2ac6bdd507a95c6494ee67e3 100755 (executable)
@@ -56,6 +56,9 @@ TYPEDEF uint64_t           uint_fast64_t;
 TYPEDEF long          intptr_t;
 TYPEDEF unsigned long uintptr_t;
 
+TYPEDEF long long          intmax_t;
+TYPEDEF unsigned long long uintmax_t;
+
 TYPEDEF float float_t;
 TYPEDEF double double_t;
 
index 417e291900a6fbe02bdeb2822b382ae26841a3f6..7d3cdc363077dc5d23c3899b83891a72d1941127 100755 (executable)
@@ -56,6 +56,9 @@ TYPEDEF uint64_t           uint_fast64_t;
 TYPEDEF int intptr_t;
 TYPEDEF unsigned uintptr_t;
 
+TYPEDEF long long          intmax_t;
+TYPEDEF unsigned long long uintmax_t;
+
 TYPEDEF float float_t;
 TYPEDEF double double_t;
 
index 62e77ac98d856e6ce6a2a7e09b3e5a8d8cf2cdd5..c5e54aab00f065055571127516c02a4db1615163 100755 (executable)
@@ -55,6 +55,9 @@ TYPEDEF uint64_t           uint_fast64_t;
 TYPEDEF long          intptr_t;
 TYPEDEF unsigned long uintptr_t;
 
+TYPEDEF long          intmax_t;
+TYPEDEF unsigned long uintmax_t;
+
 TYPEDEF float float_t;
 TYPEDEF double double_t;
 
index 486d1ac2f75120df2726eb9e2d73c88bcc77d4a6..138fb211cdc679405e9c04ba639a1051ed99df18 100644 (file)
@@ -24,6 +24,9 @@
 #define __NEED_intptr_t
 #define __NEED_uintptr_t
 
+#define __NEED_intmax_t
+#define __NEED_uintmax_t
+
 #include <bits/alltypes.h>
 
 typedef int8_t  int_least8_t;
@@ -36,25 +39,22 @@ typedef uint16_t uint_least16_t;
 typedef uint32_t uint_least32_t;
 typedef uint64_t uint_least64_t;
 
-typedef long long          intmax_t;
-typedef unsigned long long uintmax_t;
-
 #if !defined __cplusplus || defined __STDC_LIMIT_MACROS
 
 #define INT8_MIN   (-1-0x7f)
 #define INT16_MIN  (-1-0x7fff)
 #define INT32_MIN  (-1-0x7fffffff)
-#define INT64_MIN  (-1-0x7fffffffffffffffLL)
+#define INT64_MIN  (-1-0x7fffffffffffffff)
 
 #define INT8_MAX   (0x7f)
 #define INT16_MAX  (0x7fff)
 #define INT32_MAX  (0x7fffffff)
-#define INT64_MAX  (0x7fffffffffffffffLL)
+#define INT64_MAX  (0x7fffffffffffffff)
 
 #define UINT8_MAX  (0xff)
 #define UINT16_MAX (0xffff)
 #define UINT32_MAX (0xffffffff)
-#define UINT64_MAX (0xffffffffffffffffULL)
+#define UINT64_MAX (0xffffffffffffffff)
 
 #define INT_LEAST8_MIN   INT8_MIN
 #define INT_LEAST16_MIN  INT16_MIN
@@ -95,15 +95,22 @@ typedef unsigned long long uintmax_t;
 #define INT8_C(c)  c
 #define INT16_C(c) c
 #define INT32_C(c) c
-#define INT64_C(c) c ## LL
 
 #define UINT8_C(c)  c
 #define UINT16_C(c) c
 #define UINT32_C(c) c ## U
-#define UINT64_C(c) c ## ULL
 
+#if UINTPTR_MAX == UINT64_MAX
+#define INT64_C(c) c ## L
+#define UINT64_C(c) c ## UL
+#define INTMAX_C(c)  c ## L
+#define UINTMAX_C(c) c ## UL
+#else
+#define INT64_C(c) c ## LL
+#define UINT64_C(c) c ## ULL
 #define INTMAX_C(c)  c ## LL
 #define UINTMAX_C(c) c ## ULL
+#endif
 
 #endif