]> granicus.if.org Git - clang/commitdiff
Define INTMAX_C and UINTMAX_C in terms of the corresponding exact-width
authorKen Dyck <ken.dyck@onsemi.com>
Wed, 18 Nov 2009 19:42:57 +0000 (19:42 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Wed, 18 Nov 2009 19:42:57 +0000 (19:42 +0000)
INTn_C and UINTn_C macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89226 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 2b89fa43f3afe8a2c119f2b2cf74ed9251108d68..77f0e86e04c8e8a8a552fb57354d7755ef00c49c 100644 (file)
@@ -655,8 +655,8 @@ typedef __stdint_exjoin3(uint, __INTMAX_WIDTH__, _t) uintmax_t;
 #endif
 
 /* 7.18.4.2 Macros for greatest-width integer constants. */
-#define INTMAX_C(v)  v##LL
-#define UINTMAX_C(v) v##ULL
+#define INTMAX_C(v)  __stdint_exjoin3( INT, __INTMAX_WIDTH__, _C(v))
+#define UINTMAX_C(v) __stdint_exjoin3(UINT, __INTMAX_WIDTH__, _C(v))
 
 #endif /* __STDC_HOSTED__ */
 #endif /* __CLANG_STDINT_H */
index 9652319cc15832f83e87586c4efd7312b38de0dd..0f7fceaf6b89b984475a0d502ec3f123d9051e98 100644 (file)
 // MSP430:INT64_C_(0) INT64_C(0)
 // MSP430:UINT64_C_(0) UINT64_C(0)
 //
-// MSP430:INTMAX_C_(0) 0LL
-// MSP430:UINTMAX_C_(0) 0ULL
+// MSP430:INTMAX_C_(0) 0L
+// MSP430:UINTMAX_C_(0) 0UL
 //
 // RUN: clang-cc -E -ffreestanding -triple=pic16-none-none %s | FileCheck -check-prefix PIC16 %s
 // 
 // PIC16:INT64_C_(0) INT64_C(0)
 // PIC16:UINT64_C_(0) UINT64_C(0)
 //
-// PIC16:INTMAX_C_(0) 0LL
-// PIC16:UINTMAX_C_(0) 0ULL
+// PIC16:INTMAX_C_(0) 0L
+// PIC16:UINTMAX_C_(0) 0UL
 //
 // RUN: clang-cc -E -ffreestanding -triple=powerpc64-none-none %s | FileCheck -check-prefix PPC64 %s
 //
 // PPC64:INT64_C_(0) 0L
 // PPC64:UINT64_C_(0) 0UL
 //
-// PPC64:INTMAX_C_(0) 0LL
-// PPC64:UINTMAX_C_(0) 0ULL
+// PPC64:INTMAX_C_(0) 0L
+// PPC64:UINTMAX_C_(0) 0UL
 //
 // RUN: clang-cc -E -ffreestanding -triple=powerpc-none-none %s | FileCheck -check-prefix PPC %s
 //
 // S390X:INT64_C_(0) 0L
 // S390X:UINT64_C_(0) 0UL
 //
-// S390X:INTMAX_C_(0) 0LL
-// S390X:UINTMAX_C_(0) 0ULL
+// S390X:INTMAX_C_(0) 0L
+// S390X:UINTMAX_C_(0) 0UL
 //
 // RUN: clang-cc -E -ffreestanding -triple=sparc-none-none %s | FileCheck -check-prefix SPARC %s
 //
 // TCE:INT64_C_(0) INT64_C(0)
 // TCE:UINT64_C_(0) UINT64_C(0)
 //
-// TCE:INTMAX_C_(0) 0LL
-// TCE:UINTMAX_C_(0) 0ULL
+// TCE:INTMAX_C_(0) 0
+// TCE:UINTMAX_C_(0) 0U
 //
 // RUN: clang-cc -E -ffreestanding -triple=x86_64-none-none %s | FileCheck -check-prefix X86_64 %s
 //
 // X86_64:INT64_C_(0) 0L
 // X86_64:UINT64_C_(0) 0UL
 //
-// X86_64:INTMAX_C_(0) 0LL
-// X86_64:UINTMAX_C_(0) 0ULL
+// X86_64:INTMAX_C_(0) 0L
+// X86_64:UINTMAX_C_(0) 0UL
 //
 
 #include <stdint.h>