mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
LibC: Make SIZE_MAX be understood by the preprocessor
POSIX mandates that the macros contained in `stdint.h` be suitable for use by the C preprocessor. If we write `((size_t)-1)`, the C preprocessor will just skip the cast and treat the value as `-1`. This means that we end up taking the wrong branch in an `#if` directive like `#if SIZE_MAX > UINT32_MAX`. This fixes building the LLVM port on i686.
This commit is contained in:
parent
23adb7449f
commit
87d548c520
1 changed files with 1 additions and 1 deletions
|
@ -132,7 +132,7 @@ typedef __INTMAX_TYPE__ intmax_t;
|
|||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
#define SIZE_MAX ((size_t)-1)
|
||||
#define SIZE_MAX __SIZE_MAX__
|
||||
|
||||
#define PTRDIFF_MAX __PTRDIFF_MAX__
|
||||
#define PTRDIFF_MIN (-__PTRDIFF_MAX__ - 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue