]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update after gnulib changed. 0.21.x
authorBruno Haible <bruno@clisp.org>
Wed, 29 Mar 2023 00:07:28 +0000 (02:07 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 29 Mar 2023 00:07:28 +0000 (02:07 +0200)
* gettext-runtime/intl/verify.h: Update from gnulib.

gettext-runtime/intl/verify.h

index 42307c0be6bfabdd4dac74aa7cf5021c32cf7e07..657c5f916d227581ae4a939a8c3938a92ec1ed30 100644 (file)
@@ -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