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

ChangeLog
tests/test-stdbool.c

index 77862ed6237e1a31984b0ec5ee406975e7f18776..ffbed2526bc46c01eb13ad32db7e7d83a54bf1a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-19  Bruno Haible  <bruno@clisp.org>
+
+       stdbool, stdbool-c99 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  Paul Eggert  <eggert@cs.ucla.edu>
 
        stdbool: omit ‘#undef true’
index 73c871e8693d57a2e41b6ce1e360d667319dd646..923a2cd302464701ffb89d31fecbe23cf27f0a05 100644 (file)
@@ -46,8 +46,9 @@
 
 /* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at
    least, not for all compilers and compiler options.  */
-#if (HAVE_C_BOOL || defined __cplusplus \
-     || HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__)
+#if ((HAVE_C_BOOL || defined __cplusplus \
+      || HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__) \
+     && !defined _MSC_VER)
 # define WORKING_BOOL 1
 #else
 # define WORKING_BOOL 0