]> 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:58:33 +0000 (23:58 +0200)
* tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
define _MSC_VER.

ChangeLog
tests/test-stdbool.c

index 9fc4414496964654a7c94b204b3a95f879e45f08..52df80174d68d6a15640470a3076995c4472e06a 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 27fd16d0103737adbbd7caf2f21d6bf9602968cf..5a754f8c739cfd9e2f12998fceea234d061d870c 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