From d89f715f1a9e967a0ba246a5c226b51a76035f5c Mon Sep 17 00:00:00 2001 From: David Seifert Date: Fri, 3 Jun 2016 21:35:20 +0200 Subject: [PATCH] Make stdbool.m4 as compatible as possible for C++ --- m4/stdbool.m4 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index a556153..463092e 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -44,7 +44,7 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL], [[ #include - #if __cplusplus < 201103 + #ifndef __cplusplus #ifndef bool "error: bool is not defined" #endif @@ -66,29 +66,29 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL], "error: __bool_true_false_are_defined is not defined" #endif - struct s { _Bool s: 1; _Bool t; } s; + struct s { bool s: 1; bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; + char f[(bool) 0.0 == false ? 1 : -1]; char g[true]; - char h[sizeof (_Bool)]; + char h[sizeof (bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; + bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + char p[-1 - (bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ - _Bool q = true; - _Bool *pq = &q; + bool q = true; + bool *pq = &q; ]], [[ bool e = &s; -- 2.8.3