From 5e53de69ad0e1ab317c9cfa6050b9997b5d7b055 Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 28 Dec 2004 22:44:39 +0000 Subject: [PATCH] stdbool.h --- conf-end.h | 18 +++++++++++++++++- config.h | 5 ++++- configure.in | 4 ++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/conf-end.h b/conf-end.h index f066e40..eb4f97d 100644 --- a/conf-end.h +++ b/conf-end.h @@ -1,4 +1,4 @@ -/** $MirBSD: src/bin/ksh/conf-end.h,v 2.6 2004/12/18 19:27:21 tg Exp $ */ +/** $MirBSD: src/bin/ksh/conf-end.h,v 2.7 2004/12/28 22:44:39 tg Exp $ */ /* $OpenBSD: conf-end.h,v 1.2 1996/08/25 12:37:58 downsj Exp $ */ #ifndef CONF_END_H @@ -74,4 +74,20 @@ # define GCC_FUNC_ATTR2(x,y) #endif /* HAVE_GCC_FUNC_ATTR */ +#ifndef HAVE_STDBOOL_H +#if defined(__GNUC__) && __GNUC__ >= 3 +/* Support for _C99: type _Bool is already built-in. */ +#define false 0 +#define true 1 +#else +typedef enum { + false = 0, + true = 1 +} _Bool; +#define false false +#define true true +#endif +#define bool _Bool +#endif + #endif /* ndef CONF_END_H */ diff --git a/config.h b/config.h index 7534ade..5f5dfa0 100644 --- a/config.h +++ b/config.h @@ -1,4 +1,4 @@ -/** $MirBSD: src/bin/ksh/config.h,v 2.2 2004/12/13 19:05:08 tg Exp $ */ +/** $MirBSD: src/bin/ksh/config.h,v 2.3 2004/12/28 22:44:39 tg Exp $ */ /* $OpenBSD: config.h,v 1.9 2003/10/22 07:40:38 jmc Exp $ */ /* @@ -311,6 +311,9 @@ /* Define if you have the header file. */ #define HAVE_PATHS_H 1 +/* Define if you have the header file. */ +#define HAVE_STDBOOL_H 1 + /* Define if you have the header file. */ #define HAVE_STDDEF_H 1 diff --git a/configure.in b/configure.in index 3b7e11d..4e35770 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $MirBSD: src/bin/ksh/configure.in,v 2.1 2004/12/10 18:09:41 tg Exp $ +dnl $MirBSD: src/bin/ksh/configure.in,v 2.2 2004/12/28 22:44:39 tg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl @@ -25,7 +25,7 @@ AC_HEADER_DIRENT KSH_UNISTD_H KSH_TERM_CHECK AC_CHECK_HEADERS(sys/param.h sys/types.h sys/resource.h sys/time.h \ - stddef.h stdlib.h stdint.h string.h limits.h paths.h \ + stdbool.h stddef.h stdint.h stdlib.h string.h limits.h paths.h \ memory.h fcntl.h values.h ulimit.h) AC_HEADER_TIME KSH_HEADER_SYS_WAIT