From 2835914e9a04dbfa99f24dce9f3e44ec7ee2b88d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 29 Mar 2023 02:07:28 +0200 Subject: [PATCH] Update after gnulib changed. * gettext-runtime/intl/verify.h: Update from gnulib. --- gettext-runtime/intl/verify.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gettext-runtime/intl/verify.h b/gettext-runtime/intl/verify.h index 42307c0be..657c5f916 100644 --- a/gettext-runtime/intl/verify.h +++ b/gettext-runtime/intl/verify.h @@ -220,8 +220,15 @@ template /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ #ifdef _GL_STATIC_ASSERT_H # if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert -# define _Static_assert(R, ...) \ - _GL_VERIFY ((R), "static assertion failed", -) +# if !defined _MSC_VER || defined __clang__ +# define _Static_assert(...) \ + _GL_VERIFY (__VA_ARGS__, "static assertion failed", -) +# else + /* Work around MSVC preprocessor incompatibility with ISO C; see + . */ +# define _Static_assert(R, ...) \ + _GL_VERIFY ((R), "static assertion failed", -) +# endif # endif # if (!defined static_assert \ && (!defined __cplusplus \ @@ -231,9 +238,8 @@ template /* MSVC 14 in C++ mode supports the two-arguments static_assert but not the one-argument static_assert, and it does not support _Static_assert. We have to play preprocessor tricks to distinguish the two cases. - Since the MSVC preprocessor is not ISO C compliant (cf. - ), the solution is specific - to MSVC. */ + Since the MSVC preprocessor is not ISO C compliant (see above),. + the solution is specific to MSVC. */ # define _GL_EXPAND(x) x # define _GL_SA1(a1) static_assert ((a1), "static assertion failed") # define _GL_SA2 static_assert -- 2.47.2