summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Mehnert <frank.mehnert@kernkonzept.com>2025-03-05 15:26:34 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2025-03-22 09:11:47 +0100
commit0ef6b7d204b851771d9c0ffbdbc81bd77f42fb25 (patch)
treefb2e55c218f6cd3f723495e632bb464f7af24ff5
parentf4164a55c5c946c58b5691460436ae34ce6e428c (diff)
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 <stdint.h> 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 <marcus.haehnel@kernkonzept.com>
-rw-r--r--include/stdint.h8
1 files changed, 8 insertions, 0 deletions
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. */