]> granicus.if.org Git - clang/commitdiff
Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
authorKen Dyck <ken.dyck@onsemi.com>
Fri, 20 Nov 2009 16:49:10 +0000 (16:49 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Fri, 20 Nov 2009 16:49:10 +0000 (16:49 +0000)
UINT<n>_C(v) macros.

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

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

index fee7d3c1b822d1ea9fe5e558744c78bc61256f06..0502275c0b0f0d19b106dc35fa659e197495b7ac 100644 (file)
@@ -214,7 +214,6 @@ 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)
 
 #define  __intn_t(n) __stdint_join3( int, n, _t)
 #define __uintn_t(n) __stdint_join3(uint, n, _t)
@@ -638,8 +637,11 @@ typedef __uintn_t(__INTMAX_WIDTH__) uintmax_t;
 #endif
 
 /* 7.18.4.2 Macros for greatest-width integer constants. */
-#define INTMAX_C(v)  __stdint_exjoin3( INT, __INTMAX_WIDTH__, _C(v))
-#define UINTMAX_C(v) __stdint_exjoin3(UINT, __INTMAX_WIDTH__, _C(v))
+#define  __INTN_C(n, v) __stdint_join3( INT, n, _C(v))
+#define __UINTN_C(n, v) __stdint_join3(UINT, n, _C(v))
+
+#define INTMAX_C(v)   __INTN_C(__INTMAX_WIDTH__, v)
+#define UINTMAX_C(v) __UINTN_C(__INTMAX_WIDTH__, v)
 
 #endif /* __STDC_HOSTED__ */
 #endif /* __CLANG_STDINT_H */
index 05b3165d39b4793b72aaedc588a85adb209c8db5..930474645f17438b54d44ccff78771654800a8c4 100644 (file)
 // JOIN:WINT_MAX_ 2147483647
 // JOIN:WCHAR_MAX_ 2147483647
 // JOIN:WCHAR_MIN_ (-2147483647 -1)
-// TODO:INTMAX_C_(0) 0LL
-// TODO:UINTMAX_C_(0) 0ULL
+// JOIN:INTMAX_C_(0) 0LL
+// JOIN:UINTMAX_C_(0) 0ULL
 
 #include <stdint.h>