From: Bruno Haible Date: Tue, 30 Apr 2002 18:19:02 +0000 (+0000) Subject: Portability to OSF/1 5.1 cc. X-Git-Tag: v0.11.3~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=394c1c56bb6a2a0246d60512d17b482fc3c9c46d;p=thirdparty%2Fgettext.git Portability to OSF/1 5.1 cc. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 29a0039c9..502ef44cc 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2002-04-30 Bruno Haible + + * stdbool.h.in (_Bool): Omit the definition if _Bool is already known + as a builtin primitive type. Needed for cc on OSF/1 5.1. + * Makefile.am (stdbool.h): Substitute the value of HAVE__BOOL. + 2002-04-26 Bruno Haible * basename.h: Use __GLIBC__ instead of __GNU_LIBRARY__, because diff --git a/lib/Makefile.am b/lib/Makefile.am index 5a5df0e01..97c487a21 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -118,7 +118,7 @@ DISTCLEANFILES = fnmatch.h all-local c-ctype.lo execute.lo javacomp.lo javaexec.lo pipe-bidi.lo pipe-in.lo pipe-out.lo progname.lo tmpdir.lo wait-process.lo xerror.lo: @STDBOOL_H@ stdbool.h: stdbool.h.in - cp $(srcdir)/stdbool.h.in stdbool.h + sed -e 's/@''HAVE__BOOL''@/@HAVE__BOOL@/g' < $(srcdir)/stdbool.h.in > stdbool.h MOSTLYCLEANFILES = @STDBOOL_H@ diff --git a/lib/stdbool.h.in b/lib/stdbool.h.in index 16b43886d..69f6ef725 100644 --- a/lib/stdbool.h.in +++ b/lib/stdbool.h.in @@ -1,4 +1,4 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -31,7 +31,9 @@ /* For the sake of symbolic names in gdb, define _Bool as an enum type. */ #ifndef __cplusplus +# if !@HAVE__BOOL@ typedef enum { false = 0, true = 1 } _Bool; +# endif #else typedef bool _Bool; #endif diff --git a/m4/ChangeLog b/m4/ChangeLog index 2f6056e88..0d72d0779 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2002-04-30 Bruno Haible + + * stdbool.m4 (gt_STDBOOL_H): If does not exist, check for + _Bool as a builtin primitive type. Needed for cc on OSF/1 5.1. + 2002-04-24 Bruno Haible * gettext-0.11.2 released. diff --git a/m4/stdbool.m4 b/m4/stdbool.m4 index f01f89c6c..d0959fc70 100644 --- a/m4/stdbool.m4 +++ b/m4/stdbool.m4 @@ -1,4 +1,4 @@ -# stdbool.m4 serial 1 (gettext-0.11) +# stdbool.m4 serial 2 (gettext-0.11.3) dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -32,6 +32,17 @@ if test $gt_cv_header_stdbool_h = yes; then STDBOOL_H='' else STDBOOL_H='stdbool.h' + AC_MSG_CHECKING([for _Bool type]) + AC_CACHE_VAL(gt_cv_type_Bool, [ + AC_TRY_COMPILE([_Bool x = sizeof (_Bool);], [], + gt_cv_type_Bool=yes, gt_cv_type_Bool=no)]) + AC_MSG_RESULT([$gt_cv_type_Bool]) + if test $gt_cv_type_Bool = yes; then + HAVE__BOOL=1 + else + HAVE__BOOL=0 + fi + AC_SUBST(HAVE__BOOL) fi AC_SUBST(STDBOOL_H) ])