Преглед на файлове

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>
Frank Mehnert преди 1 месец
родител
ревизия
0ef6b7d204
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 8 0
      include/stdint.h

+ 8 - 0
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.  */