From: Collin Funk Date: Sun, 11 May 2025 16:41:48 +0000 (-0700) Subject: fts: Make sure __GNU_PREREQ is defined (regression yesterday). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a92aa179978a136fa9cc9023d02b5529b19a2210;p=thirdparty%2Fgnulib.git fts: Make sure __GNU_PREREQ is defined (regression yesterday). Reported by in . * lib/fts_.h (__GNUC_PREREQ): Define macro on clang or if the system does not define it. --- diff --git a/ChangeLog b/ChangeLog index 2db4885fb0..2ddb9c3ba9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-05-11 Collin Funk + + fts: Make sure __GNU_PREREQ is defined (regression yesterday). + Reported by in + . + * lib/fts_.h (__GNUC_PREREQ): Define macro on clang or if the system + does not define it. + 2025-05-10 Bruno Haible string-desc: Fixes for string literals and older GCC versions. diff --git a/lib/fts_.h b/lib/fts_.h index 052858da7b..aa5b88f19c 100644 --- a/lib/fts_.h +++ b/lib/fts_.h @@ -66,6 +66,18 @@ # include # 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