This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Move cpplib to the toplevel


Attached is a proper patch.

Ok for mainline if Roman's test passes?

Thanks,

Paolo
--- ../gcc-save/config/acx.m4	2004-05-24 15:00:07.000000000 +0200
+++ ../gcc/config/acx.m4	2004-05-29 09:05:23.000000000 +0200
@@ -240,20 +240,50 @@
 dnl Check whether _Bool is built-in.
 AC_DEFUN([ACX_HEADER_STDBOOL],
 [AC_CACHE_CHECK([for working stdbool.h],
-  ac_cv_header_stdbool_h,
-[AC_TRY_COMPILE([#include <stdbool.h>],
-[bool foo = false;],
-ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
-if test $ac_cv_header_stdbool_h = yes; then
+  acx_cv_header_stdbool_h,
+[AC_TRY_COMPILE([#include <stdbool.h>
+#ifndef bool
+# error bool is not defined
+#endif
+#ifndef false
+# error false is not defined
+#endif
+#if false
+# error false is not 0
+#endif
+#ifndef true
+# error true is not defined
+#endif
+#if true != 1
+# error true is not 1
+#endif
+#ifndef __bool_true_false_are_defined
+# error __bool_true_false_are_defined is not defined
+#endif
+
+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];
+bool e = &s;
+char f[(_Bool) -0.0 == false ? 1 : -1];
+char g[true];
+char h[sizeof (_Bool) == 1 ? 1 : -1];
+char i[sizeof s.t];
+],[return !a + !b + !c + !d + !e + !f + !g + !h + !i;],
+[acx_cv_header_stdbool_h=yes],
+[acx_cv_header_stdbool_h=no])])
+if test $acx_cv_header_stdbool_h = yes; then
   AC_DEFINE(HAVE_STDBOOL_H, 1,
   [Define if you have a working <stdbool.h> header file.])
 fi
-AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
+AC_CACHE_CHECK(for built-in _Bool, acx_cv_c__bool,
 [AC_TRY_COMPILE(,
 [_Bool foo;],
-gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
+acx_cv_c__bool=yes, acx_cv_c__bool=no)
 ])
-if test $gcc_cv_c__bool = yes; then
+if test $acx_cv_c__bool = yes; then
   AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
 fi
 ])

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]