Changeset 4063bbd56844345154c9701e8947d1cf18a0e731

Committer: realnc Author: realnc Parent: 15f7e312c6
Date: 7 months ago (2009/08/24 19:53)
Don't use C++-style comments

Even though the comments are inside #ifdef __cplusplus blocks, GCC still warns
when compiled using -pedantic (without -ansi).

Affected files

src/common.h

15f7e312c606b400937b2aa43e0af27cf4f0d5354063bbd56844345154c9701e8947d1cf18a0e731
66
66
67
#ifdef __cplusplus
67
#ifdef __cplusplus
68
68
69
// Define the "and", "or" and "not" keywords if the C++ compiler lacks
69
/* Define the "and", "or" and "not" keywords if the C++ compiler lacks
70
// them.  Normally, if just one of them is available, the others are
70
 * them.  Normally, if just one of them is available, the others are
71
// too.  But there is no harm in checking them individually.  We only
71
 * too.  But there is no harm in checking them individually.  We only
72
// define them when compiling C++, since a) these keywords are not valid
72
 * define them when compiling C++, since a) these keywords are not valid
73
// in C and b) some C compilers define them either for convenience or to
73
 * in C and b) some C compilers define them either for convenience or to
74
// support C99.
74
 * support C99.
75
 */
75
#ifndef HAVE_AND_KEYWORD
76
#ifndef HAVE_AND_KEYWORD
76
#define and &&
77
#define and &&
77
#endif
78
#endif
...
...
82
#define not !
83
#define not !
83
#endif
84
#endif
84
85
85
// For casting, C++ code should *not* use X_cast<type>(value) but rather
86
/* For casting, C++ code should *not* use X_cast<type>(value) but rather
86
// X_cast(type)(value).  If the compiler supports the X_cast keywords,
87
 * X_cast(type)(value).  If the compiler supports the X_cast keywords,
87
// we define the X_cast macros to use the right syntax.  If not, we make
88
 * we define the X_cast macros to use the right syntax.  If not, we make
88
// them use old-style syntax.
89
 * them use old-style syntax.
90
 */
89
#ifdef HAVE_STATIC_CAST
91
#ifdef HAVE_STATIC_CAST
90
#define static_cast(a) static_cast<a>
92
#define static_cast(a) static_cast<a>
91
#else
93
#else
...
...
105
#endif
107
#endif
106
108
107
#ifndef HAVE_BOOL
109
#ifndef HAVE_BOOL
108
// The C++ compiler lacks "bool".  Define it.  We do not use macros for
110
/* The C++ compiler lacks "bool".  Define it.  We do not use macros for
109
// this; with an enum and typedef we always have the same type-safety as
111
 * this; with an enum and typedef we always have the same type-safety as
110
// with a compiler that has native bool-support.  Implicit casts to
112
 * with a compiler that has native bool-support.  Implicit casts to
111
// "int" still work as they should.
113
 * "int" still work as they should.
114
 */
112
enum booleanValues { false, true };
115
enum booleanValues { false, true };
113
typedef enum booleanValues bool;
116
typedef enum booleanValues bool;
114
#endif
117
#endif