[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with stdbool.h redefining true/false even in C++
From: |
Paul Eggert |
Subject: |
Re: Problem with stdbool.h redefining true/false even in C++ |
Date: |
Wed, 29 Aug 2012 17:45:52 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 |
On 08/29/2012 02:07 PM, Michael Goffioul wrote:
> Thanks for that.
Your welcome. While in an unrelated meeting today it
popped into my head that the patch wasn't quite right,
as in C++ mode it defines _Bool to _Bool (via bool),
not to bool as it should. I pushed this further
patch to fix that:
>From 4d41ee34707396d205a8036a80da7c717e77a4f7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Wed, 29 Aug 2012 17:43:04 -0700
Subject: [PATCH] * lib/stdbool.in.h (_Bool) [__cplusplus]: bool, not _Bool.
---
lib/stdbool.in.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/stdbool.in.h b/lib/stdbool.in.h
index 924c8ff..1261936 100644
--- a/lib/stdbool.in.h
+++ b/lib/stdbool.in.h
@@ -68,6 +68,7 @@
#ifdef __cplusplus
# define _Bool bool
+# define bool bool
#else
# if defined __BEOS__ && !defined __HAIKU__
/* A compiler known to have 'bool'. */
@@ -114,8 +115,8 @@ typedef enum { _Bool_must_promote_to_int = -1, false = 0,
true = 1 } _Bool;
# endif
# endif
# endif
+# define bool _Bool
#endif
-#define bool _Bool
/* The other macros must be usable in preprocessor directives. */
#ifdef __cplusplus
--
1.7.11.4
- Problem with stdbool.h redefining true/false even in C++, Michael Goffioul, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Paul Eggert, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Michael Goffioul, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Michael Goffioul, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, John W. Eaton, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, John W. Eaton, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Paul Eggert, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Michael Goffioul, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Paul Eggert, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Michael Goffioul, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++,
Paul Eggert <=
- Re: Problem with stdbool.h redefining true/false even in C++, John W. Eaton, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Bastien ROUCARIES, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, John W. Eaton, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Daniel J Sebald, 2012/08/29
- Re: Problem with stdbool.h redefining true/false even in C++, Paul Eggert, 2012/08/29