summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-09-04 16:24:56 +0200
committerBruno Haible <bruno@clisp.org>2022-09-04 16:24:56 +0200
commit99b0ab09036e16ad845438938d9b607f2d3f346a (patch)
tree00e3ef9670b774cbf3d027072170c8cf4e927a37 /lib
parentec12214656506dbd4d21800fc7fee33c5af6fc00 (diff)
downloadgnulib-99b0ab09036e16ad845438938d9b607f2d3f346a.tar.gz
stdbool: Fix compilation error in C++ mode with MSVC 14.
* lib/stdbool.in.h (_Bool, bool, false, true): In C++ mode with MSVC 14, don't define these as macros.
Diffstat (limited to 'lib')
-rw-r--r--lib/stdbool.in.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
index 2fa46724b2..36f26560af 100644
--- a/lib/stdbool.in.h
+++ b/lib/stdbool.in.h
@@ -59,8 +59,10 @@
/* 7.16. Boolean type and values */
#ifdef __cplusplus
-# define _Bool bool
-# define bool bool
+# if !defined _MSC_VER
+# define _Bool bool
+# define bool bool
+# endif
#else
# if !defined __GNUC__
/* If @HAVE__BOOL@:
@@ -103,8 +105,10 @@ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
/* The other macros must be usable in preprocessor directives. */
#ifdef __cplusplus
-# define false false
-# define true true
+# if !defined _MSC_VER
+# define false false
+# define true true
+# endif
#else
# define false 0
# define true 1