comparison port/stdbool.h @ 63:d78c4d9fad13

Move to port/ code that I didn't write
author David Demelier <markand@malikania.fr>
date Wed, 09 Nov 2011 19:30:33 +0100
parents stdbool.h@a7ff7f59c7f6
children b1a084c030c8
comparison
equal deleted inserted replaced
62:d10ab6bc555d 63:d78c4d9fad13
1 /*
2 * stdbool.h -- pseudo boolean type (portable version)
3 *
4 * Copyright (c) 2011, David Demelier <markand@malikania.fr>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 #ifndef _STDBOOL_H_
20 #define _STDBOOL_H_
21
22 /*
23 * Allow using pseudo booleans that use 1 byte using the char data
24 * type.
25 */
26
27 #define __bool_true_false_are_defined 1
28
29 #ifndef __cplusplus
30 #define false 0
31 #define true 1
32 typedef char bool;
33 #endif
34
35 #endif /* _STDBOOL_H_ */