From f9a5d9a70af495d60d6d15057768ab1e8d787bf7 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 22 Aug 2010 21:56:01 -0400 Subject: [PATCH] Define bool Signed-off-by: Anders Kaseorg --- configure.ac | 2 ++ nonlocal.h | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index fbf3247..9221340 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,8 @@ AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL +AC_HEADER_STDBOOL + case "$target_cpu" in i386 | i486 | i586 | i686 | i786) AC_DEFINE([USE_REGPARMS], [], diff --git a/nonlocal.h b/nonlocal.h index a0746d4..b31a9a9 100644 --- a/nonlocal.h +++ b/nonlocal.h @@ -27,6 +27,23 @@ #define NONLOCAL_H #include "config.h" + +#ifdef HAVE_STDBOOL_H +# include +#else +# ifndef HAVE__BOOL +# ifdef __cplusplus +typedef bool _Bool; +# else +# define _Bool signed char +# endif +# endif +# define bool _Bool +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +#endif + #include "nsswitch-internal.h" struct walk_nss { -- 2.45.0