From b6ddb32201f1ce9934ad2f6744f8b5b36b7acccb Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Sun, 18 Sep 2016 17:50:06 +0200 Subject: [PATCH] Remove define and usage of HAVE_BOOL This define was only used twice. Once surrounded by a `#if 0` and once only if HAVE_STDBOOL_H wasn't defined (HAVE_STDBOOL_H is part of the C99 standard library and is always defined). --- config.iffe | 10 ---------- configure.ac | 15 --------------- contrib/diffimg/diffimg.c | 3 --- lib/common/logic.h | 9 --------- windows/include/config.h | 3 --- 5 files changed, 40 deletions(-) diff --git a/config.iffe b/config.iffe index be5be11f9..e735e4470 100644 --- a/config.iffe +++ b/config.iffe @@ -99,16 +99,6 @@ link{ #define HAVE_INTPTR_T 1 }end -compile{ - #ifdef HAVE_STDBOOL_H - #include - #endif - bool xx = true, yy = false; -}end yes{ -/* Define to 1 if compiler supports bool */ -#define HAVE_BOOL 1 -}end - compile{ #include iconv_t xx; diff --git a/configure.ac b/configure.ac index 8cde55a28..53a8bd11a 100644 --- a/configure.ac +++ b/configure.ac @@ -438,21 +438,6 @@ AC_HEADER_STDBOOL # Internationalization macros # AM_GNU_GETTEXT -# ----------------------------------- -# Test if compiler supports bool -AC_MSG_CHECKING([for bool]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #ifdef HAVE_STDBOOL_H> - #include - #endif - ]], [[ - bool foo==true, bar=false; - ]])],[ -AC_MSG_RESULT(yes) -AC_DEFINE(HAVE_BOOL, 1,[Define to 1 if compiler supports bool]) - ],[ -AC_MSG_RESULT(no)]) - # ----------------------------------- # Test for direct I/O AC_MSG_CHECKING([for struct dioattr]) diff --git a/contrib/diffimg/diffimg.c b/contrib/diffimg/diffimg.c index 8fb04e4b0..90041dc6d 100644 --- a/contrib/diffimg/diffimg.c +++ b/contrib/diffimg/diffimg.c @@ -59,9 +59,6 @@ #endif #define NOT(v) (!(v)) -#if ! defined HAVE_BOOL && ! defined HAVE_STDBOOL_H && ! defined __cplusplus -typedef unsigned char bool; -#endif #ifndef false #define false 0 #define true NOT(false) diff --git a/lib/common/logic.h b/lib/common/logic.h index 224c276ff..ea939986b 100644 --- a/lib/common/logic.h +++ b/lib/common/logic.h @@ -26,15 +26,6 @@ extern "C" { #define NOT(v) (!(v)) #endif -#if 0 -/* HAVE_BOOL only tested the CC compiler, we know C++ must define bool */ -#if ! defined HAVE_BOOL && ! defined __cplusplus -typedef unsigned char bool; -#define false 0 -#define true NOT(false) -#endif -#endif - #ifndef FALSE #define FALSE (0) #endif diff --git a/windows/include/config.h b/windows/include/config.h index c69f0b21e..96ba033d8 100644 --- a/windows/include/config.h +++ b/windows/include/config.h @@ -44,9 +44,6 @@ /* Define if you have the ann library */ #define HAVE_ANN 1 -/* Define to 1 if compiler supports bool */ -#define HAVE_BOOL 1 - /* Define to 1 if you have the `cbrt' function. */ //#define HAVE_CBRT 1 -- 2.50.1