summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-06-20 12:17:05 (GMT)
committerBrad King <brad.king@kitware.com>2012-06-20 12:17:05 (GMT)
commit539064d4f73269a887ea032cac431f84fea594e7 (patch)
treeb5a6515365e0685b2ceb311ad4850fe2a9009b3e
parent6240f853a34705abe90114239cc303f4369fe9d4 (diff)
downloadCMake-539064d4f73269a887ea032cac431f84fea594e7.zip
CMake-539064d4f73269a887ea032cac431f84fea594e7.tar.gz
CMake-539064d4f73269a887ea032cac431f84fea594e7.tar.bz2
KWIML: Generalize interface to report broken integer literal macros
The <inttypes.h> header on some platforms define the integer literal macros incorrectly for some of the integer types. Generalize the documented interface reporting broken U/INT64_C to all integer sizes.
-rw-r--r--INT.h.in19
1 files changed, 10 insertions, 9 deletions
diff --git a/INT.h.in b/INT.h.in
index d40edcd..c760b9e 100644
--- a/INT.h.in
+++ b/INT.h.in
@@ -91,10 +91,11 @@ An includer may test the following macros after inclusion:
Some compilers define integer format macros incorrectly for their
own formatted print/scan implementations.
- @KWIML@_INT_BROKEN_INT64_C = macro INT64_C is incorrect if defined
- @KWIML@_INT_BROKEN_UINT64_C = macro UINT64_C is incorrect if defined
+ @KWIML@_INT_BROKEN_INT#_C = macro INT#_C is incorrect if defined
+ @KWIML@_INT_BROKEN_UINT#_C = macro UINT#_C is incorrect if defined
Some compilers define integer constant macros incorrectly and
- cannot handle literals as large as the integer type.
+ cannot handle literals as large as the integer type or even
+ produce bad preprocessor syntax.
@KWIML@_INT_BROKEN_INT8_T = type 'int8_t' is available but incorrect
Some compilers have a flag to make 'char' (un)signed but do not account
@@ -341,12 +342,12 @@ An includer may test the following macros after inclusion:
#endif
/* 8-bit constants */
-#if defined(INT8_C)
+#if defined(INT8_C) && !defined(@KWIML@_INT_BROKEN_INT8_C)
# define @KWIML@_INT_INT8_C(c) INT8_C(c)
#else
# define @KWIML@_INT_INT8_C(c) c
#endif
-#if defined(UINT8_C)
+#if defined(UINT8_C) && !defined(@KWIML@_INT_BROKEN_UINT8_C)
# define @KWIML@_INT_UINT8_C(c) UINT8_C(c)
#else
# define @KWIML@_INT_UINT8_C(c) c ## u
@@ -435,12 +436,12 @@ An includer may test the following macros after inclusion:
#endif
/* 16-bit constants */
-#if defined(INT16_C)
+#if defined(INT16_C) && !defined(@KWIML@_INT_BROKEN_INT16_C)
# define @KWIML@_INT_INT16_C(c) INT16_C(c)
#else
# define @KWIML@_INT_INT16_C(c) c
#endif
-#if defined(UINT16_C)
+#if defined(UINT16_C) && !defined(@KWIML@_INT_BROKEN_UINT16_C)
# define @KWIML@_INT_UINT16_C(c) UINT16_C(c)
#else
# define @KWIML@_INT_UINT16_C(c) c ## u
@@ -529,12 +530,12 @@ An includer may test the following macros after inclusion:
#endif
/* 32-bit constants */
-#if defined(INT32_C)
+#if defined(INT32_C) && !defined(@KWIML@_INT_BROKEN_INT32_C)
# define @KWIML@_INT_INT32_C(c) INT32_C(c)
#else
# define @KWIML@_INT_INT32_C(c) c
#endif
-#if defined(UINT32_C)
+#if defined(UINT32_C) && !defined(@KWIML@_INT_BROKEN_UINT32_C)
# define @KWIML@_INT_UINT32_C(c) UINT32_C(c)
#else
# define @KWIML@_INT_UINT32_C(c) c ## u