web
Last change
on this file since f6f3e91 was
f6f3e91,
checked in by Jessica B. Hamrick <jhamrick@…>, 15 years ago
|
Preserve directory hierarchy (not sure what happened to it)
|
-
Property mode set to
100644
|
File size:
1023 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Portability wrapper around <stdbool.h>. |
---|
3 | * |
---|
4 | * Provides the bool and _Bool types and the true and false constants, |
---|
5 | * following the C99 specification, on hosts that don't have stdbool.h. This |
---|
6 | * logic is based heavily on the example in the Autoconf manual. |
---|
7 | * |
---|
8 | * Written by Russ Allbery <rra@stanford.edu> |
---|
9 | * This work is hereby placed in the public domain by its author. |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef PORTABLE_STDBOOL_H |
---|
13 | #define PORTABLE_STDBOOL_H 1 |
---|
14 | |
---|
15 | #if HAVE_STDBOOL_H |
---|
16 | # include <stdbool.h> |
---|
17 | #else |
---|
18 | # if HAVE__BOOL |
---|
19 | # define bool _Bool |
---|
20 | # else |
---|
21 | # ifdef __cplusplus |
---|
22 | typedef bool _Bool; |
---|
23 | # elif _WIN32 |
---|
24 | # include <windef.h> |
---|
25 | # define bool BOOL |
---|
26 | # else |
---|
27 | typedef unsigned char _Bool; |
---|
28 | # define bool _Bool |
---|
29 | # endif |
---|
30 | # endif |
---|
31 | # define false 0 |
---|
32 | # define true 1 |
---|
33 | # define __bool_true_false_are_defined 1 |
---|
34 | #endif |
---|
35 | |
---|
36 | /* |
---|
37 | * If we define bool and don't tell Perl, it will try to define its own and |
---|
38 | * fail. Only of interest for programs that also include Perl headers. |
---|
39 | */ |
---|
40 | #ifndef HAS_BOOL |
---|
41 | # define HAS_BOOL 1 |
---|
42 | #endif |
---|
43 | |
---|
44 | #endif /* !PORTABLE_STDBOOL_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.