# HG changeset patch # User Bruno Haible # Date 1054932569 0 # Node ID 04e1f040287de8418d9d5ee89d456d6b133ea072 # Parent 010d5e8442d93352fa92d47cba48eb7f10d23172 Moved here from stdbool.h.in. diff --git a/lib/stdbool_.h b/lib/stdbool_.h new file mode 100644 --- /dev/null +++ b/lib/stdbool_.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2001-2002 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _STDBOOL_H +#define _STDBOOL_H + +/* ISO C 99 for platforms that lack it. */ + +/* 7.16. Boolean type and values */ + +/* BeOS already #defines false 0, true 1. We use the same + definitions below, but temporarily we have to #undef them. */ +#ifdef __BEOS__ +# undef false +# undef true +#endif + +/* For the sake of symbolic names in gdb, define _Bool as an enum type. */ +#ifndef __cplusplus +# if !@HAVE__BOOL@ +typedef enum { false = 0, true = 1 } _Bool; +# endif +#else +typedef bool _Bool; +#endif +#define bool _Bool + +/* The other macros must be usable in preprocessor directives. */ +#define false 0 +#define true 1 +#define __bool_true_false_are_defined 1 + +#endif /* _STDBOOL_H */