diff options
author | 2004-10-02 12:55:31 +0000 | |
---|---|---|
committer | 2004-10-02 12:55:31 +0000 | |
commit | 139a1b9574c93a0fe8715ef0b8546f7771d91ff5 (patch) | |
tree | 135158f0f63e42d4835afb74299df06656e25379 | |
parent | convert to 64 bit (diff) | |
download | wireguard-openbsd-139a1b9574c93a0fe8715ef0b8546f7771d91ff5.tar.xz wireguard-openbsd-139a1b9574c93a0fe8715ef0b8546f7771d91ff5.zip |
let stdbool.h work with recent gcc, since they modified the interface,
again...
okay millert@ a while back, needed some more paranoid testing from my
part...
-rw-r--r-- | include/stdbool.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/stdbool.h b/include/stdbool.h index 7324f4b3229..fca59bca603 100644 --- a/include/stdbool.h +++ b/include/stdbool.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdbool.h,v 1.2 1999/09/24 23:09:09 espie Exp $ */ +/* $OpenBSD: stdbool.h,v 1.3 2004/10/02 12:55:31 espie Exp $ */ /* * Written by Marc Espie, September 25, 1999 @@ -8,6 +8,14 @@ #ifndef _STDBOOL_H_ #define _STDBOOL_H_ +#ifndef __cplusplus + +#if defined(__GNUC__) && __GNUC__ >= 3 +/* Support for _C99: type _Bool is already built-in. */ +#define false 0 +#define true 1 + +#else /* `_Bool' type must promote to `int' or `unsigned int'. */ typedef enum { false = 0, @@ -18,9 +26,18 @@ typedef enum { #define false false #define true true +#endif + /* User visible type `bool' is provided as a macro which may be redefined */ #define bool _Bool +#else /* __cplusplus */ +#define _Bool bool +#define bool bool +#define false false +#define true true +#endif /* __cplusplus */ + /* Inform that everything is fine */ #define __bool_true_false_are_defined 1 |