Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of

arbitrary widths.

llvm-svn: 89347
This commit is contained in:
Ken Dyck 2009-11-19 14:03:24 +00:00
parent 575128656e
commit 279ed5189c
1 changed files with 1 additions and 16 deletions

View File

@ -608,22 +608,7 @@ typedef __stdint_exjoin3(uint, __INTMAX_WIDTH__, _t) uintmax_t;
#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)