From 0ef6b7d204b851771d9c0ffbdbc81bd77f42fb25 Mon Sep 17 00:00:00 2001 From: Frank Mehnert Date: Wed, 5 Mar 2025 15:26:34 +0100 Subject: stdint.h: don't define __INT64_C / __UINT64_C if already defined Recent Clang versions (Starting from 20) have this macro built-in. The compiler does not warn about this normally because is a system header. In special cases where stdint.h may be included as normal header it does warn however. Avoid re-defining if a definition already exists. Signed-off-by: Marcus Haehnel --- include/stdint.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/stdint.h b/include/stdint.h index 749f73697..5fedfb574 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -144,11 +144,19 @@ typedef unsigned long long int uintmax_t; # if __WORDSIZE == 64 +# ifndef __INT64_C # define __INT64_C(c) c ## L +# endif +# ifndef __UINT64_C # define __UINT64_C(c) c ## UL +# endif # else +# ifndef __INT64_C # define __INT64_C(c) c ## LL +# endif +# ifndef __UINT64_C # define __UINT64_C(c) c ## ULL +# endif # endif /* Limits of integral types. */ -- cgit v1.2.3