[cfe-commits] r89239 - /cfe/trunk/lib/Headers/stdint.h
Ken Dyck
ken.dyck at onsemi.com
Wed Nov 18 12:36:30 PST 2009
Author: kjdyck
Date: Wed Nov 18 14:36:29 2009
New Revision: 89239
URL: http://llvm.org/viewvc/llvm-project?rev=89239&view=rev
Log:
Construct INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX from the exact-width limit
macros corresponding to __INTPTR_WIDTH__.
Modified:
cfe/trunk/lib/Headers/stdint.h
Modified: cfe/trunk/lib/Headers/stdint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stdint.h?rev=89239&r1=89238&r2=89239&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/stdint.h (original)
+++ cfe/trunk/lib/Headers/stdint.h Wed Nov 18 14:36:29 2009
@@ -603,29 +603,24 @@
/* C99 7.18.2.4 Limits of integer types capable of holding object pointers. */
/* C99 7.18.3 Limits of other integer types. */
+#define INTPTR_MIN __stdint_exjoin3( INT, __INTPTR_WIDTH__, _MIN)
+#define INTPTR_MAX __stdint_exjoin3( INT, __INTPTR_WIDTH__, _MAX)
+#define UINTPTR_MAX __stdint_exjoin3(UINT, __INTPTR_WIDTH__, _MAX)
+
#if __POINTER_WIDTH__ == 64
-#define INTPTR_MIN INT64_MIN
-#define INTPTR_MAX INT64_MAX
-#define UINTPTR_MAX UINT64_MAX
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
#define SIZE_MAX UINT64_MAX
#elif __POINTER_WIDTH__ == 32
-#define INTPTR_MIN INT32_MIN
-#define INTPTR_MAX INT32_MAX
-#define UINTPTR_MAX UINT32_MAX
#define PTRDIFF_MIN INT32_MIN
#define PTRDIFF_MAX INT32_MAX
#define SIZE_MAX UINT32_MAX
#elif __POINTER_WIDTH__ == 16
-#define INTPTR_MIN INT16_MIN
-#define INTPTR_MAX INT16_MAX
-#define UINTPTR_MAX UINT16_MAX
#define PTRDIFF_MIN INT16_MIN
#define PTRDIFF_MAX INT16_MAX
#define SIZE_MAX UINT16_MAX
More information about the cfe-commits
mailing list