diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2022-12-08 17:35:13 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2022-12-08 17:35:13 +0100 |
commit | 1b1ad4ed2919fbc68d8905cfec38a968821ce372 (patch) | |
tree | 5532a7e21342f88f4df7cd42139e012b6bd1dbe6 /gnulib-m4/stdbool.m4 | |
parent | 63b5c0db2dc641876e58d232220c7efc2b2c2423 (diff) | |
parent | fa82e850f8d894ae4b9cd75bd12ffeeb65974d50 (diff) |
Merge branch 'release/debian/1.1-1_experimental1'debian/1.1-1_experimental1
Diffstat (limited to 'gnulib-m4/stdbool.m4')
-rw-r--r-- | gnulib-m4/stdbool.m4 | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/gnulib-m4/stdbool.m4 b/gnulib-m4/stdbool.m4 deleted file mode 100644 index 3e6c4005..00000000 --- a/gnulib-m4/stdbool.m4 +++ /dev/null @@ -1,117 +0,0 @@ -# Check for stdbool.h that conforms to C99. - -dnl Copyright (C) 2002-2006, 2009-2022 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. - -#serial 9 - -# Prepare for substituting <stdbool.h> if it is not supported. - -AC_DEFUN([gl_STDBOOL_H], -[ - AC_REQUIRE([AC_CHECK_HEADER_STDBOOL]) - AC_REQUIRE([AC_CANONICAL_HOST]) - - dnl On some platforms, <stdbool.h> does not exist or does not conform to C99. - dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable - dnl in C++ mode (and no <cstdbool> exists). In this case, we use our - dnl replacement, also in C mode (for binary compatibility between C and C++). - if test "$ac_cv_header_stdbool_h" = yes; then - case "$host_os" in - solaris*) - if test -z "$GCC"; then - GL_GENERATE_STDBOOL_H=true - else - GL_GENERATE_STDBOOL_H=false - fi - ;; - *) - GL_GENERATE_STDBOOL_H=false - ;; - esac - else - GL_GENERATE_STDBOOL_H=true - fi - - if test "$ac_cv_type__Bool" = yes; then - HAVE__BOOL=1 - else - HAVE__BOOL=0 - fi - AC_SUBST([HAVE__BOOL]) -]) - -# This version of the macro is needed in autoconf <= 2.68. - -AC_DEFUN([AC_CHECK_HEADER_STDBOOL], - [AC_CACHE_CHECK([for stdbool.h that conforms to C99], - [ac_cv_header_stdbool_h], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ - #include <stdbool.h> - - #ifdef __cplusplus - typedef bool Bool; - #else - typedef _Bool Bool; - #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 - #endif - - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - - struct s { Bool s: 1; Bool t; bool u: 1; bool v; } 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 g[true]; - 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]; - char o[sizeof n == m * sizeof n[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 - https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html - */ - Bool q = true; - Bool *pq = &q; - bool *qq = &q; - ]], - [[ - bool e = &s; - *pq |= q; *pq |= ! q; - *qq |= q; *qq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq + !qq); - ]])], - [ac_cv_header_stdbool_h=yes], - [ac_cv_header_stdbool_h=no])]) - AC_CHECK_TYPES([_Bool]) -]) |