From cdf12ee48247d39e7b1fd40289b78741aa4d4df1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 Jul 2011 17:05:59 +0200 Subject: [PATCH] Work around declaration collisions on Minix. * m4/mbsinit.m4 (gl_FUNC_MBSINIT): If mbsinit is declared but not defined, set REPLACE_MBSINIT. * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): If mbrtowc is declared but not defined, set REPLACE_MBRTOWC. * m4/mbrlen.m4 (gl_FUNC_MBRLEN): If mbrlen is declared but not defined, set REPLACE_MBRLEN. * m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): If mbsrtowcs is declared but not defined, set REPLACE_MBSRTOWCS. * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): If wcrtomb is declared but not defined, set REPLACE_WCRTOMB. * m4/wcsrtombs.m4 (gl_FUNC_WCSRTOMBS): If wcsrtombs is declared but not defined, set REPLACE_WCSRTOMBS. --- ChangeLog | 16 ++++++++++++++++ m4/mbrlen.m4 | 18 +++++++++++++++++- m4/mbrtowc.m4 | 18 +++++++++++++++++- m4/mbsinit.m4 | 18 +++++++++++++++++- m4/mbsrtowcs.m4 | 18 +++++++++++++++++- m4/wcrtomb.m4 | 18 +++++++++++++++++- m4/wcsrtombs.m4 | 18 +++++++++++++++++- 7 files changed, 118 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 666d98f07..f41fb6534 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2011-07-31 Bruno Haible + Work around declaration collisions on Minix. + * m4/mbsinit.m4 (gl_FUNC_MBSINIT): If mbsinit is declared but not + defined, set REPLACE_MBSINIT. + * m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): If mbrtowc is declared but not + defined, set REPLACE_MBRTOWC. + * m4/mbrlen.m4 (gl_FUNC_MBRLEN): If mbrlen is declared but not defined, + set REPLACE_MBRLEN. + * m4/mbsrtowcs.m4 (gl_FUNC_MBSRTOWCS): If mbsrtowcs is declared but not + defined, set REPLACE_MBSRTOWCS. + * m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): If wcrtomb is declared but not + defined, set REPLACE_WCRTOMB. + * m4/wcsrtombs.m4 (gl_FUNC_WCSRTOMBS): If wcsrtombs is declared but not + defined, set REPLACE_WCSRTOMBS. + +2011-07-31 Bruno Haible + Add support for Minix with ACK compiler. * m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): New macro. * gnulib-tool (func_import, func_create_testdir): Emit invocation of diff --git a/m4/mbrlen.m4 b/m4/mbrlen.m4 index 884f8cdb4..8d6fb2369 100644 --- a/m4/mbrlen.m4 +++ b/m4/mbrlen.m4 @@ -1,4 +1,4 @@ -# mbrlen.m4 serial 7 +# mbrlen.m4 serial 8 dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -13,6 +13,22 @@ AC_DEFUN([gl_FUNC_MBRLEN], AC_CHECK_FUNCS_ONCE([mbrlen]) if test $ac_cv_func_mbrlen = no; then HAVE_MBRLEN=0 + AC_CHECK_DECLS([mbrlen],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbrlen = yes; then + dnl On Minix 3.1.8, the system's declares mbrlen() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBRLEN=1 + fi else dnl Most bugs affecting the system's mbrtowc function also affect the dnl mbrlen function. So override mbrlen whenever mbrtowc is overridden. diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4 index b9e01e7a0..aa2fdfe37 100644 --- a/m4/mbrtowc.m4 +++ b/m4/mbrtowc.m4 @@ -1,4 +1,4 @@ -# mbrtowc.m4 serial 24 +# mbrtowc.m4 serial 25 dnl Copyright (C) 2001-2002, 2004-2005, 2008-2011 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -15,6 +15,22 @@ AC_DEFUN([gl_FUNC_MBRTOWC], AC_CHECK_FUNCS_ONCE([mbrtowc]) if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 + AC_CHECK_DECLS([mbrtowc],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbrtowc = yes; then + dnl On Minix 3.1.8, the system's declares mbrtowc() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBRTOWC=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBRTOWC=1 diff --git a/m4/mbsinit.m4 b/m4/mbsinit.m4 index d364b7e0f..27e06d761 100644 --- a/m4/mbsinit.m4 +++ b/m4/mbsinit.m4 @@ -1,4 +1,4 @@ -# mbsinit.m4 serial 7 +# mbsinit.m4 serial 8 dnl Copyright (C) 2008, 2010-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -15,6 +15,22 @@ AC_DEFUN([gl_FUNC_MBSINIT], AC_CHECK_FUNCS_ONCE([mbsinit]) if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 + AC_CHECK_DECLS([mbsinit],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbsinit = yes; then + dnl On Minix 3.1.8, the system's declares mbsinit() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSINIT=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBSINIT=1 diff --git a/m4/mbsrtowcs.m4 b/m4/mbsrtowcs.m4 index 025198a91..065df9287 100644 --- a/m4/mbsrtowcs.m4 +++ b/m4/mbsrtowcs.m4 @@ -1,4 +1,4 @@ -# mbsrtowcs.m4 serial 12 +# mbsrtowcs.m4 serial 13 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,22 @@ AC_DEFUN([gl_FUNC_MBSRTOWCS], AC_CHECK_FUNCS_ONCE([mbsrtowcs]) if test $ac_cv_func_mbsrtowcs = no; then HAVE_MBSRTOWCS=0 + AC_CHECK_DECLS([mbsrtowcs],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_mbsrtowcs = yes; then + dnl On Minix 3.1.8, the system's declares mbsrtowcs() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_MBSRTOWCS=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_MBSRTOWCS=1 diff --git a/m4/wcrtomb.m4 b/m4/wcrtomb.m4 index d21f1b9a7..be5e8151e 100644 --- a/m4/wcrtomb.m4 +++ b/m4/wcrtomb.m4 @@ -1,4 +1,4 @@ -# wcrtomb.m4 serial 10 +# wcrtomb.m4 serial 11 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,22 @@ AC_DEFUN([gl_FUNC_WCRTOMB], AC_CHECK_FUNCS_ONCE([wcrtomb]) if test $ac_cv_func_wcrtomb = no; then HAVE_WCRTOMB=0 + AC_CHECK_DECLS([wcrtomb],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_wcrtomb = yes; then + dnl On Minix 3.1.8, the system's declares wcrtomb() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_WCRTOMB=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_WCRTOMB=1 diff --git a/m4/wcsrtombs.m4 b/m4/wcsrtombs.m4 index 7ce575961..143b1befd 100644 --- a/m4/wcsrtombs.m4 +++ b/m4/wcsrtombs.m4 @@ -1,4 +1,4 @@ -# wcsrtombs.m4 serial 10 +# wcsrtombs.m4 serial 11 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,22 @@ AC_DEFUN([gl_FUNC_WCSRTOMBS], AC_CHECK_FUNCS_ONCE([wcsrtombs]) if test $ac_cv_func_wcsrtombs = no; then HAVE_WCSRTOMBS=0 + AC_CHECK_DECLS([wcsrtombs],,, [[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +]]) + if test $ac_cv_have_decl_wcsrtombs = yes; then + dnl On Minix 3.1.8, the system's declares wcsrtombs() although + dnl it does not have the function. Avoid a collision with gnulib's + dnl replacement. + REPLACE_WCSRTOMBS=1 + fi else if test $REPLACE_MBSTATE_T = 1; then REPLACE_WCSRTOMBS=1 -- 2.11.0