summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-03-29 02:07:28 +0200
committerBruno Haible <bruno@clisp.org>2023-03-29 02:07:28 +0200
commit2835914e9a04dbfa99f24dce9f3e44ec7ee2b88d (patch)
tree5be4daffcd6b9027a800e47a3709bdac3722a247
parentba4742b0b410f2074eaf56cd86217e24388728b4 (diff)
downloadgettext-0.21.x.tar.gz
Update after gnulib changed.0.21.x
* gettext-runtime/intl/verify.h: Update from gnulib.
-rw-r--r--gettext-runtime/intl/verify.h16
1 files 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 <int w>
/* _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
+ <https://stackoverflow.com/questions/5134523/>. */
+# define _Static_assert(R, ...) \
+ _GL_VERIFY ((R), "static assertion failed", -)
+# endif
# endif
# if (!defined static_assert \
&& (!defined __cplusplus \
@@ -231,9 +238,8 @@ template <int w>
/* 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.
- <https://stackoverflow.com/questions/5134523/>), 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