diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-27 23:02:25 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-08-27 23:02:25 +0000 |
commit | c92b450891cc03d1656fb314664fc33632f4bd3e (patch) | |
tree | 7bbba9cb83d21b4b991b3596031e124abfcfcc78 /src | |
parent | 814f40cf43fc899e854b2c09219c5285da3eda04 (diff) | |
download | postgresql-c92b450891cc03d1656fb314664fc33632f4bd3e.tar.gz postgresql-c92b450891cc03d1656fb314664fc33632f4bd3e.zip |
Suppress definitions of 'true' and 'false' macros if __cplusplus.
Since we're assuming a C++ compiler knows what 'bool' is, seems we
should assume it knows 'true' and 'false' too. This prevents problems
on some systems, per report from Leandro Fanzone.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/c.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/c.h b/src/include/c.h index 4a96810ca0a..37d360d941b 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -12,7 +12,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: c.h,v 1.100 2001/08/24 22:46:28 petere Exp $ + * $Id: c.h,v 1.101 2001/08/27 23:02:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -133,10 +133,13 @@ * Section 2: bool, true, false, TRUE, FALSE, NULL * ---------------------------------------------------------------- */ + /* * bool * Boolean value, either true or false. * + * XXX for C++ compilers, we assume the compiler has a compatible + * built-in definition of bool. */ /* BeOS defines bool already, but the compiler chokes on the @@ -145,11 +148,10 @@ #ifndef __BEOS__ #ifndef __cplusplus + #ifndef bool typedef char bool; - -#endif /* ndef bool */ -#endif /* not C++ */ +#endif #ifndef true #define true ((bool) 1) @@ -159,6 +161,8 @@ typedef char bool; #define false ((bool) 0) #endif +#endif /* not C++ */ + #endif /* __BEOS__ */ typedef bool *BoolPtr; |