From 0814a293a4e40e49a8a0d2d5d94f04cc170a7e2a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Oct 2022 16:43:06 +0200 Subject: [PATCH] assert-h: Make static_assert work on Solaris 11.4. * m4/assert_h.m4 (gl_ASSERT_H): After including , on Solaris, redefine static_assert. --- ChangeLog | 6 ++++++ m4/assert_h.m4 | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 76a56c78f2..6f4bea5c1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-10-23 Bruno Haible + + assert-h: Make static_assert work on Solaris 11.4. + * m4/assert_h.m4 (gl_ASSERT_H): After including , on Solaris, + redefine static_assert. + 2022-10-16 Bruno Haible getdelim: Work around buggy implementation on macOS 10.13. diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index c1306daef4..e892ea2f01 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -57,5 +57,11 @@ AC_DEFUN([gl_ASSERT_H], && __GNUG__ < 6 && __clang_major__ < 6))) #include #undef/**/assert + /* Solaris 11.4 defines static_assert as a macro with 2 arguments. + We need it also to be invocable with a single argument. */ + #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus + #undef static_assert + #define static_assert _Static_assert + #endif #endif]) ]) -- 2.39.5