From 6f1a9ef2072621a22cd0f38c89afc5c7598682e3 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 27 Oct 2022 08:32:20 +0200 Subject: [PATCH] lib:replace: Require bool from C99 https://fedoraproject.org/wiki/Changes/PortingToModernC We define True to true from stdbool.h and the same for false. So we don't have to do a cleanup now. Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Oct 27 19:11:30 UTC 2022 on sn-devel-184 --- lib/replace/replace.h | 6 +----- lib/replace/wscript | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/replace/replace.h b/lib/replace/replace.h index bd7f6e53e81..de50761d000 100644 --- a/lib/replace/replace.h +++ b/lib/replace/replace.h @@ -699,13 +699,9 @@ int rep_strerror_r(int errnum, char *buf, size_t buflen); #include #endif -#if !defined(HAVE_BOOL) -#ifdef HAVE__Bool -#define bool _Bool -#else +#ifndef HAVE_BOOL #error Need a real boolean type #endif -#endif #if !defined(HAVE_INTPTR_T) typedef long long intptr_t ; diff --git a/lib/replace/wscript b/lib/replace/wscript index b675069c7de..b1ca95515a0 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -160,8 +160,7 @@ def configure(conf): msg='Checking for O_DIRECT flag to open(2)') conf.CHECK_TYPES('"long long" intptr_t uintptr_t ptrdiff_t comparison_fn_t') - if not conf.CHECK_TYPE('bool', define='HAVE_BOOL'): - if not conf.CHECK_TYPE('_Bool', define='HAVE__Bool'): + if not conf.CHECK_TYPE('bool', define='HAVE_BOOL', headers='stdbool.h'): raise Errors.WafError('Samba requires a genuine boolean type') conf.CHECK_TYPE('int8_t', 'char')