]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
fts: Make sure __GNU_PREREQ is defined (regression yesterday).
authorCollin Funk <collin.funk1@gmail.com>
Sun, 11 May 2025 16:41:48 +0000 (09:41 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Sun, 11 May 2025 16:43:19 +0000 (09:43 -0700)
Reported by <nroycea+gnu@gmail.com> in
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78376>.

* lib/fts_.h (__GNUC_PREREQ): Define macro on clang or if the system
does not define it.

ChangeLog
lib/fts_.h

index 2db4885fb08365bcf2dd7056d860848f5a9a6c06..2ddb9c3ba9f9276147cbe094f26a68aad3041211 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-05-11  Collin Funk  <collin.funk1@gmail.com>
+
+       fts: Make sure __GNU_PREREQ is defined (regression yesterday).
+       Reported by <nroycea+gnu@gmail.com> in
+       <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78376>.
+       * lib/fts_.h (__GNUC_PREREQ): Define macro on clang or if the system
+       does not define it.
+
 2025-05-10  Bruno Haible  <bruno@clisp.org>
 
        string-desc: Fixes for string literals and older GCC versions.
index 052858da7b924fccede38bb54eec601d80e8719f..aa5b88f19cf6d546e3e254d8e53b6d7780f52be7 100644 (file)
 #   include <sys/cdefs.h>
 #  endif
 #  define __FLEXIBLE_ARRAY_MEMBER FLEXIBLE_ARRAY_MEMBER
+#  if defined __clang__
+  /* clang really only groks GNU C 4.2, regardless of its value of __GNUC__.  */
+#   undef __GNUC_PREREQ
+#   define __GNUC_PREREQ(maj, min) ((maj) < 4 + ((min) <= 2))
+#  endif
+#  ifndef __GNUC_PREREQ
+#   if defined __GNUC__ && defined __GNUC_MINOR__
+#    define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))
+#   else
+#    define __GNUC_PREREQ(maj, min) 0
+#   endif
+#  endif
 #  ifndef __THROW
 #   if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
 #    if __cplusplus >= 201103L