From: Paul Eggert Date: Fri, 3 Jan 2003 14:14:24 +0000 (+0000) Subject: (_Bool, bool, false, true, __bool_true_false_are_defined): X-Git-Tag: BISON-2_0~453 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/1029ea6d02f1ed28a27b890c4e74c50d2054a8e3 (_Bool, bool, false, true, __bool_true_false_are_defined): Use the pattern recommended by Autoconf 2.57, except also protect against double-inclusion. --- diff --git a/lib/hash.c b/lib/hash.c index 26e7b617..4657e6d4 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,5 +1,8 @@ /* hash - hashing table processing. - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. + Written by Jim Meyering, 1992. This program is free software; you can redistribute it and/or modify @@ -27,11 +30,25 @@ #if HAVE_STDLIB_H # include #endif + #if HAVE_STDBOOL_H # include #else -typedef enum {false = 0, true = 1} bool; +# ifndef __bool_true_false_are_defined +# if ! HAVE__BOOL +# ifdef __cplusplus +typedef bool _Bool; +# else +typedef unsigned char _Bool; +# endif +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +# endif #endif + #include #ifndef HAVE_DECL_FREE