1/* Copyright (C) 2001-2002 Free Software Foundation, Inc. 2 Written by Bruno Haible <haible@clisp.cons.org>, 2001. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 2, or (at your option) 7 any later version. 8 9 This program is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with this program; if not, write to the Free Software Foundation, 16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 17 18#ifndef _STDBOOL_H 19#define _STDBOOL_H 20 21/* ISO C 99 <stdbool.h> for platforms that lack it. */ 22 23/* 7.16. Boolean type and values */ 24 25/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same 26 definitions below, but temporarily we have to #undef them. */ 27#ifdef __BEOS__ 28# undef false 29# undef true 30#endif 31 32/* For the sake of symbolic names in gdb, define _Bool as an enum type. */ 33#ifndef __cplusplus 34# if !0 35typedef enum { false = 0, true = 1 } _Bool; 36# endif 37#else 38typedef bool _Bool; 39#endif 40#define bool _Bool 41 42/* The other macros must be usable in preprocessor directives. */ 43#define false 0 44#define true 1 45#define __bool_true_false_are_defined 1 46 47#endif /* _STDBOOL_H */ 48