X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fstdbool.m4;h=b25b7d2440b8c970f5d657d3c902ce3a4a9eaf4b;hb=be1c8adeedf52b5ceee7091a43c1937ea2caaa7d;hp=def6e147f8ab06c362a6217e5eae4646022ef4ea;hpb=e059c2358aad79ce8dfd9581dd6f12ce8503dc63;p=gnulib.git diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index def6e147f..b25b7d244 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -# Copyright (C) 2002 Free Software Foundation, Inc. +# Copyright (C) 2002-2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,30 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. -# This file is only needed in autoconf <= 2.54. Newer versions of autoconf +# Prepare for substituting if it is not supported. + +AC_DEFUN([AM_STDBOOL_H], +[ + AC_REQUIRE([AC_HEADER_STDBOOL]) + + # Define two additional variables used in the Makefile substitution. + + if test "$ac_cv_header_stdbool_h" = yes; then + STDBOOL_H='' + else + STDBOOL_H='stdbool.h' + fi + AC_SUBST([STDBOOL_H]) + + if test "$ac_cv_type__Bool" = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + AC_SUBST([HAVE__BOOL]) +]) + +# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf # have this macro built-in. AC_DEFUN([AC_HEADER_STDBOOL], @@ -36,7 +59,7 @@ AC_DEFUN([AC_HEADER_STDBOOL], "error: false is not 0" #endif #ifndef true - "error: false is not defined" + "error: true is not defined" #endif #if true != 1 "error: true is not 1" @@ -56,8 +79,14 @@ AC_DEFUN([AC_HEADER_STDBOOL], char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + ], + [ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + + !m + !n + !o); ], - [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool])