Files

49 lines
2.8 KiB
Diff

Clang and GCC originally interpreted the spec differently when
implementing _Generic. Some of the gnulib code doesn't work with the
old clang implementation.
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2396.htm#dr_481
--- gettext-tools/libgettextpo/string-desc.h.orig 2026-01-13 21:57:46
+++ gettext-tools/libgettextpo/string-desc.h 2026-03-07 20:01:18
@@ -54,7 +54,10 @@
int f (int x) { return _Generic (x, char *: 2, int: 3); }
*/
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __cplusplus) /* C mode */ \
- || (defined __clang__ && __clang_major__ >= 3) /* both C and C++ mode */ \
+ || (defined __clang__ && ((!defined __apple_build_version__ && (__clang_major__ > 3 \
+ || (__clang_major__ == 3 && __clang_minor__ >= 8))) \
+ || (defined __apple_build_version__ && (__clang_major__ > 7 \
+ || (__clang_major__ == 7 && __clang_minor__ >= 3))))) /* both C and C++ mode */ \
|| (defined __SUNPRO_C && __SUNPRO_C >= 0x5150) /* C mode */ \
|| (__STDC_VERSION__ >= 201112L && !defined __GNUC__) /* C mode */
# define HAVE__GENERIC 1
--- gettext-tools/gnulib-lib/string-desc.h.orig 2026-01-13 21:57:46
+++ gettext-tools/gnulib-lib/string-desc.h 2026-03-07 20:01:18
@@ -54,7 +54,10 @@
int f (int x) { return _Generic (x, char *: 2, int: 3); }
*/
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __cplusplus) /* C mode */ \
- || (defined __clang__ && __clang_major__ >= 3) /* both C and C++ mode */ \
+ || (defined __clang__ && ((!defined __apple_build_version__ && (__clang_major__ > 3 \
+ || (__clang_major__ == 3 && __clang_minor__ >= 8))) \
+ || (defined __apple_build_version__ && (__clang_major__ > 7 \
+ || (__clang_major__ == 7 && __clang_minor__ >= 3))))) /* both C and C++ mode */ \
|| (defined __SUNPRO_C && __SUNPRO_C >= 0x5150) /* C mode */ \
|| (__STDC_VERSION__ >= 201112L && !defined __GNUC__) /* C mode */
# define HAVE__GENERIC 1
--- gettext-runtime/gnulib-lib/string-desc.h.orig 2026-01-13 21:57:46
+++ gettext-runtime/gnulib-lib/string-desc.h 2026-03-07 20:01:18
@@ -54,7 +54,10 @@
int f (int x) { return _Generic (x, char *: 2, int: 3); }
*/
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __cplusplus) /* C mode */ \
- || (defined __clang__ && __clang_major__ >= 3) /* both C and C++ mode */ \
+ || (defined __clang__ && ((!defined __apple_build_version__ && (__clang_major__ > 3 \
+ || (__clang_major__ == 3 && __clang_minor__ >= 8))) \
+ || (defined __apple_build_version__ && (__clang_major__ > 7 \
+ || (__clang_major__ == 7 && __clang_minor__ >= 3))))) /* both C and C++ mode */ \
|| (defined __SUNPRO_C && __SUNPRO_C >= 0x5150) /* C mode */ \
|| (__STDC_VERSION__ >= 201112L && !defined __GNUC__) /* C mode */
# define HAVE__GENERIC 1