[cfe-commits] r89347 - /cfe/trunk/lib/Headers/stdint.h

Ken Dyck ken.dyck at onsemi.com
Thu Nov 19 06:03:24 PST 2009


Author: kjdyck
Date: Thu Nov 19 08:03:24 2009
New Revision: 89347

URL: http://llvm.org/viewvc/llvm-project?rev=89347&view=rev
Log:
Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of
arbitrary widths.


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=89347&r1=89346&r2=89347&view=diff

==============================================================================
--- cfe/trunk/lib/Headers/stdint.h (original)
+++ cfe/trunk/lib/Headers/stdint.h Thu Nov 19 08:03:24 2009
@@ -608,22 +608,7 @@
 #define UINTPTR_MAX __stdint_exjoin3(UINT, __INTPTR_WIDTH__, _MAX)
 #define PTRDIFF_MIN __stdint_exjoin3( INT, __PTRDIFF_WIDTH__, _MIN)
 #define PTRDIFF_MAX __stdint_exjoin3( INT, __PTRDIFF_WIDTH__, _MAX)
-
-#if __POINTER_WIDTH__ == 64
-
-#define SIZE_MAX    UINT64_MAX
-
-#elif __POINTER_WIDTH__ == 32
-
-#define SIZE_MAX    UINT32_MAX
-
-#elif __POINTER_WIDTH__ == 16
-
-#define SIZE_MAX    UINT16_MAX
-
-#else
-#error "unknown or unset pointer width!"
-#endif
+#define    SIZE_MAX __stdint_exjoin3(UINT, __SIZE_WIDTH__, _MAX)
 
 /* C99 7.18.2.5 Limits of greatest-width integer types. */
 #define INTMAX_MIN  __stdint_exjoin3( INT, __INTMAX_WIDTH__, _MIN)





More information about the cfe-commits mailing list