mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +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
Notes:
sideshowbarker
2024-07-18 02:13:10 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/87d548c5201 Pull-request: https://github.com/SerenityOS/serenity/pull/10996 Reviewed-by: https://github.com/timschumi ✅
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
Reference in a new issue