]> granicus.if.org Git - clang/commitdiff
Define intptr_t and uintptr_t in terms of their equivalent exact-width types.
authorKen Dyck <ken.dyck@onsemi.com>
Wed, 18 Nov 2009 20:24:13 +0000 (20:24 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Wed, 18 Nov 2009 20:24:13 +0000 (20:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89237 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/stdint.h
test/Preprocessor/stdint.c

index 77f0e86e04c8e8a8a552fb57354d7755ef00c49c..edc6e87503e17adfda9863f822519316d14e8f52 100644 (file)
@@ -213,16 +213,17 @@ typedef __uint_least8_t uint_fast8_t;
 
 /* C99 7.18.1.4 Integer types capable of holding object pointers.
  */
+#define __stdint_join3(a,b,c) a ## b ## c
+#define __stdint_exjoin3(a,b,c) __stdint_join3(a,b,c)
+
 #ifndef __intptr_t_defined
-typedef __INTPTR_TYPE__          intptr_t;
+typedef __stdint_exjoin3( int, __INTPTR_WIDTH__, _t) intptr_t;
 #define __intptr_t_defined
 #endif
-typedef unsigned __INTPTR_TYPE__ uintptr_t;
+typedef __stdint_exjoin3(uint, __INTPTR_WIDTH__, _t) uintptr_t;
 
 /* C99 7.18.1.5 Greatest-width integer types.
  */
-#define __stdint_join3(a,b,c) a ## b ## c
-#define __stdint_exjoin3(a,b,c) __stdint_join3(a,b,c)
 typedef __stdint_exjoin3( int, __INTMAX_WIDTH__, _t) intmax_t;
 typedef __stdint_exjoin3(uint, __INTMAX_WIDTH__, _t) uintmax_t;
 
index 0f7fceaf6b89b984475a0d502ec3f123d9051e98..9c98e291664c4616b2600a8108cff292acddd5b3 100644 (file)
@@ -28,8 +28,8 @@
 // ARM:typedef int8_t int_fast8_t;
 // ARM:typedef uint8_t uint_fast8_t;
 //
-// ARM:typedef long int intptr_t;
-// ARM:typedef unsigned long int uintptr_t;
+// ARM:typedef int32_t intptr_t;
+// ARM:typedef uint32_t uintptr_t;
 // 
 // ARM:typedef int64_t intmax_t;
 // ARM:typedef uint64_t uintmax_t;
 // BFIN:typedef int8_t int_fast8_t;
 // BFIN:typedef uint8_t uint_fast8_t;
 //
-// BFIN:typedef long int intptr_t;
-// BFIN:typedef unsigned long int uintptr_t;
+// BFIN:typedef int32_t intptr_t;
+// BFIN:typedef uint32_t uintptr_t;
 //
 // BFIN:typedef int64_t intmax_t;
 // BFIN:typedef uint64_t uintmax_t;
 // I386:typedef int8_t int_fast8_t;
 // I386:typedef uint8_t uint_fast8_t;
 //
-// I386:typedef int intptr_t;
-// I386:typedef unsigned int uintptr_t;
+// I386:typedef int32_t intptr_t;
+// I386:typedef uint32_t uintptr_t;
 //
 // I386:typedef int64_t intmax_t;
 // I386:typedef uint64_t uintmax_t;
 // MSP430:typedef int8_t int_fast8_t;
 // MSP430:typedef uint8_t uint_fast8_t;
 //
-// MSP430:typedef short intptr_t;
-// MSP430:typedef unsigned short uintptr_t;
+// MSP430:typedef int16_t intptr_t;
+// MSP430:typedef uint16_t uintptr_t;
 //
 // MSP430:typedef int32_t intmax_t;
 // MSP430:typedef uint32_t uintmax_t;
 // PIC16:typedef int8_t int_fast8_t;
 // PIC16:typedef uint8_t uint_fast8_t;
 //
-// PIC16:typedef short intptr_t;
-// PIC16:typedef unsigned short uintptr_t;
+// PIC16:typedef int16_t intptr_t;
+// PIC16:typedef uint16_t uintptr_t;
 //
 // PIC16:typedef int32_t intmax_t;
 // PIC16:typedef uint32_t uintmax_t;
 // PPC64:typedef int8_t int_fast8_t;
 // PPC64:typedef uint8_t uint_fast8_t;
 //
-// PPC64:typedef long int intptr_t;
-// PPC64:typedef unsigned long int uintptr_t;
+// PPC64:typedef int64_t intptr_t;
+// PPC64:typedef uint64_t uintptr_t;
 //
 // PPC64:typedef int64_t intmax_t;
 // PPC64:typedef uint64_t uintmax_t;
 // PPC:typedef int8_t int_fast8_t;
 // PPC:typedef uint8_t uint_fast8_t;
 //
-// PPC:typedef long int intptr_t;
-// PPC:typedef unsigned long int uintptr_t;
+// PPC:typedef int32_t intptr_t;
+// PPC:typedef uint32_t uintptr_t;
 //
 // PPC:typedef int64_t intmax_t;
 // PPC:typedef uint64_t uintmax_t;
 // S390X:typedef int8_t int_fast8_t;
 // S390X:typedef uint8_t uint_fast8_t;
 //
-// S390X:typedef long int intptr_t;
-// S390X:typedef unsigned long int uintptr_t;
+// S390X:typedef int64_t intptr_t;
+// S390X:typedef uint64_t uintptr_t;
 //
 // S390X:typedef int64_t intmax_t;
 // S390X:typedef uint64_t uintmax_t;
 // SPARC:typedef int8_t int_fast8_t;
 // SPARC:typedef uint8_t uint_fast8_t;
 //
-// SPARC:typedef long int intptr_t;
-// SPARC:typedef unsigned long int uintptr_t;
+// SPARC:typedef int32_t intptr_t;
+// SPARC:typedef uint32_t uintptr_t;
 //
 // SPARC:typedef int64_t intmax_t;
 // SPARC:typedef uint64_t uintmax_t;
 // TCE:typedef int8_t int_fast8_t;
 // TCE:typedef uint8_t uint_fast8_t;
 //
-// TCE:typedef int intptr_t;
-// TCE:typedef unsigned int uintptr_t;
+// TCE:typedef int32_t intptr_t;
+// TCE:typedef uint32_t uintptr_t;
 //
 // TCE:typedef int32_t intmax_t;
 // TCE:typedef uint32_t uintmax_t;
 // X86_64:typedef int8_t int_fast8_t;
 // X86_64:typedef uint8_t uint_fast8_t;
 //
-// X86_64:typedef long int intptr_t;
-// X86_64:typedef unsigned long int uintptr_t;
+// X86_64:typedef int64_t intptr_t;
+// X86_64:typedef uint64_t uintptr_t;
 //
 // X86_64:typedef int64_t intmax_t;
 // X86_64:typedef uint64_t uintmax_t;