Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of
arbitrary widths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89347 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Headers/stdint.h b/lib/Headers/stdint.h
index f7382e8..b95ae8f 100644
--- a/lib/Headers/stdint.h
+++ b/lib/Headers/stdint.h
@@ -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)