From aeb22f486139f457ae7fc44c2d931312aaae52d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 18 Jan 2023 18:25:25 +0100 Subject: Update Gnulib to v0.1-5703-g356a414e8c and add 'posix_spawn' module. This is a followup to edfca3b7e5931b5b5a83112e2a9813b068be99c2, which added the 'posix_spawnp' module but not 'posix_spawn'. * m4/gnulib-cache.m4: Add 'posix_spawn' module. * gnulib-local/m4/clock_time.m4.diff: Adjust. * configure.ac: Move 'gl_EARLY' use right after 'AC_PROG_CC'. --- m4/c-bool.m4 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 m4/c-bool.m4 (limited to 'm4/c-bool.m4') diff --git a/m4/c-bool.m4 b/m4/c-bool.m4 new file mode 100644 index 000000000..f614371bb --- /dev/null +++ b/m4/c-bool.m4 @@ -0,0 +1,51 @@ +# Check for bool that conforms to C2023. + +dnl Copyright 2022-2023 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_C_BOOL], +[ + AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ + #if true == false + #error "true == false" + #endif + extern bool b; + bool b = true == false;]])], + [gl_cv_c_bool=yes], + [gl_cv_c_bool=no])]) + if test "$gl_cv_c_bool" = yes; then + AC_DEFINE([HAVE_C_BOOL], [1], + [Define to 1 if bool, true and false work as per C2023.]) + fi + + AC_CHECK_HEADERS_ONCE([stdbool.h]) + + dnl The "zz" puts this toward config.h's end, to avoid potential + dnl collisions with other definitions. + dnl If 'bool', 'true' and 'false' do not work, arrange for them to work. + dnl In C, this means including if it is not already included. + dnl However, if the preprocessor mistakenly treats 'true' as 0, + dnl define it to a bool expression equal to 1; this is needed in + dnl Sun C++ 5.11 (Oracle Solaris Studio 12.2, 2010) and older. + AH_VERBATIM([zzbool], +[#ifndef HAVE_C_BOOL +# if !defined __cplusplus && !defined __bool_true_false_are_defined +# if HAVE_STDBOOL_H +# include +# else +# if defined __SUNPRO_C +# error " is not usable with this configuration. To make it usable, add -D_STDC_C99= to $CC." +# else +# error " does not exist on this platform. Use gnulib module 'stdbool-c99' instead of gnulib module 'stdbool'." +# endif +# endif +# endif +# if !true +# define true (!false) +# endif +#endif]) +]) -- cgit v1.2.1