Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc92b450

Browse files
committed
Suppress definitions of 'true' and 'false' macros if __cplusplus.
Since we're assuming a C++ compiler knows what 'bool' is, seems weshould assume it knows 'true' and 'false' too. This prevents problemson some systems, per report from Leandro Fanzone.
1 parent814f40c commitc92b450

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎src/include/c.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: c.h,v 1.100 2001/08/24 22:46:28 petere Exp $
15+
* $Id: c.h,v 1.101 2001/08/27 23:02:25 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -133,10 +133,13 @@
133133
*Section 2:bool, true, false, TRUE, FALSE, NULL
134134
* ----------------------------------------------------------------
135135
*/
136+
136137
/*
137138
* bool
138139
*Boolean value, either true or false.
139140
*
141+
* XXX for C++ compilers, we assume the compiler has a compatible
142+
* built-in definition of bool.
140143
*/
141144

142145
/* BeOS defines bool already, but the compiler chokes on the
@@ -145,11 +148,10 @@
145148
#ifndef__BEOS__
146149

147150
#ifndef__cplusplus
151+
148152
#ifndefbool
149153
typedefcharbool;
150-
151-
#endif/* ndef bool */
152-
#endif/* not C++ */
154+
#endif
153155

154156
#ifndeftrue
155157
#definetrue((bool) 1)
@@ -159,6 +161,8 @@ typedef char bool;
159161
#definefalse((bool) 0)
160162
#endif
161163

164+
#endif/* not C++ */
165+
162166
#endif/* __BEOS__ */
163167

164168
typedefbool*BoolPtr;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp