]> Savannah Git Hosting - gnulib.git/commitdiff
stdbool tests: Fix compilation error with clang/MSVC.
authorBruno Haible <bruno@clisp.org>
Tue, 20 Sep 2022 21:57:06 +0000 (23:57 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 20 Sep 2022 21:57:06 +0000 (23:57 +0200)
* tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
define _MSC_VER.

ChangeLog
tests/test-stdbool.c

index a5c9606cc8c04eb54bf8a12c0c19ea1b4cf51e9e..4a9f361aa3e8985bca09b561ca50a6cc18825aca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-19  Bruno Haible  <bruno@clisp.org>
+
+       stdbool tests: Fix compilation error with clang/MSVC.
+       * tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
+       define _MSC_VER.
+
 2022-09-18  Bruno Haible  <bruno@clisp.org>
 
        stdbool: Ensure that 'true' can be used in the preprocessor.
index 60c9f251c2595379758095d25994157dbc81b81d..9416db94b52773e2c02b9b8a1f77a54d7b3ac7b0 100644 (file)
@@ -44,8 +44,9 @@
 
 /* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at
    least, not for all compilers and compiler options.  */
-#if (202311 <= __STDC_VERSION__ || defined __cplusplus \
-     || HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__)
+#if ((202311 <= __STDC_VERSION__ || defined __cplusplus \
+      || HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__) \
+     && !defined _MSC_VER)
 # define WORKING_BOOL 1
 #else
 # define WORKING_BOOL 0