]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ginclude: avoid redefining __STDC_VERSION_LIMITS_H__
authorCollin Funk <collin.funk1@gmail.com>
Sun, 3 May 2026 05:18:40 +0000 (22:18 -0700)
committerSam James <sam@gentoo.org>
Sun, 3 May 2026 06:04:00 +0000 (07:04 +0100)
We define this macro after including the systems limits.h header which
may define this macro.  Using glibc-2.43, for example, before this patch
every file that included limits.h would emit a warning if
-Wsystem-headers was in use.

    PR c/125161

gcc/
* glimits.h (__STDC_VERSION_LIMITS_H__): Only define the macro
if it was not already defined.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
gcc/glimits.h

index 0d08c819ed76c9c46ad94d4511a0bb95213caa9e..2098016ef8e44d22f18e5bf806f9cb031e985271 100644 (file)
@@ -162,7 +162,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #  define BITINT_MAXWIDTH __BITINT_MAXWIDTH__
 # endif
 
-# define __STDC_VERSION_LIMITS_H__     202311L
+# ifndef __STDC_VERSION_LIMITS_H__
+#  define __STDC_VERSION_LIMITS_H__    202311L
+# endif
 #endif
 
 #endif /* _LIMITS_H___ */