Changeset 4063bbd56844345154c9701e8947d1cf18a0e731
Commiter: Nikos Chantziaras
Author: Nikos Chantziaras
Parent: 15f7e312c6
(2009/08/24 19:53) Over 2 years ago
Don't use C++-style comments Even though the comments are inside #ifdef __cplusplus blocks, GCC still warns when compiled using -pedantic (without -ansi).
// Define the "and", "or" and "not" keywords if the C++ compiler lacks/* Define the "and", "or" and "not" keywords if the C++ compiler lacks// them. Normally, if just one of them is available, the others are* them. Normally, if just one of them is available, the others are// too. But there is no harm in checking them individually. We only* too. But there is no harm in checking them individually. We only// define them when compiling C++, since a) these keywords are not valid* define them when compiling C++, since a) these keywords are not valid// in C and b) some C compilers define them either for convenience or to* in C and b) some C compilers define them either for convenience or to// support C99.* support C99.*/// For casting, C++ code should *not* use X_cast<type>(value) but rather/* For casting, C++ code should *not* use X_cast<type>(value) but rather// X_cast(type)(value). If the compiler supports the X_cast keywords,* X_cast(type)(value). If the compiler supports the X_cast keywords,// we define the X_cast macros to use the right syntax. If not, we make* we define the X_cast macros to use the right syntax. If not, we make// them use old-style syntax.* them use old-style syntax.*/// The C++ compiler lacks "bool". Define it. We do not use macros for/* The C++ compiler lacks "bool". Define it. We do not use macros for// this; with an enum and typedef we always have the same type-safety as* this; with an enum and typedef we always have the same type-safety as// with a compiler that has native bool-support. Implicit casts to* with a compiler that has native bool-support. Implicit casts to// "int" still work as they should.* "int" still work as they should.*/enum booleanValues { false, true };enum booleanValues { false, true };