From 101b00c5aabc8b99c301a818da20f2cefa2ce176 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 19 Sep 2022 21:20:33 +0200 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ tests/test-stdbool.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77862ed623..ffbed2526b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-19 Bruno Haible + + 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 stdbool: omit ‘#undef true’ diff --git a/tests/test-stdbool.c b/tests/test-stdbool.c index 73c871e869..923a2cd302 100644 --- a/tests/test-stdbool.c +++ b/tests/test-stdbool.c @@ -46,8 +46,9 @@ /* Several tests cannot be guaranteed with gnulib's , 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 -- 2.39.5