[cfe-commits] r89461 - in /cfe/trunk: lib/Headers/stdint.h test/Preprocessor/stdint.c

Ken Dyck ken.dyck at onsemi.com
Fri Nov 20 08:49:10 PST 2009


Author: kjdyck
Date: Fri Nov 20 10:49:10 2009
New Revision: 89461

URL: http://llvm.org/viewvc/llvm-project?rev=89461&view=rev
Log:
Avoid unwanted expansion in macros that paste together INT<n>_C(v) and 
UINT<n>_C(v) macros. 


Modified:
    cfe/trunk/lib/Headers/stdint.h
    cfe/trunk/test/Preprocessor/stdint.c

Modified: cfe/trunk/lib/Headers/stdint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdint.h?rev=89461&r1=89460&r2=89461&view=diff

==============================================================================
--- cfe/trunk/lib/Headers/stdint.h (original)
+++ cfe/trunk/lib/Headers/stdint.h Fri Nov 20 10:49:10 2009
@@ -214,7 +214,6 @@
 /* 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 @@
 #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 */

Modified: cfe/trunk/test/Preprocessor/stdint.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/stdint.c?rev=89461&r1=89460&r2=89461&view=diff

==============================================================================
--- cfe/trunk/test/Preprocessor/stdint.c (original)
+++ cfe/trunk/test/Preprocessor/stdint.c Fri Nov 20 10:49:10 2009
@@ -1185,8 +1185,8 @@
 // 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>
 





More information about the cfe-commits mailing list