Work around declaration collisions on Minix.
authorBruno Haible <bruno@clisp.org>
Sun, 31 Jul 2011 15:05:59 +0000 (17:05 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 31 Jul 2011 15:05:59 +0000 (17:05 +0200)
* 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
m4/mbrlen.m4
m4/mbrtowc.m4
m4/mbsinit.m4
m4/mbsrtowcs.m4
m4/wcrtomb.m4
m4/wcsrtombs.m4

index 666d98f..f41fb65 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2011-07-31  Bruno Haible  <bruno@clisp.org>
 
+       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  <bruno@clisp.org>
+
        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
index 884f8cd..8d6fb23 100644 (file)
@@ -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: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbrlen = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> 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.
index b9e01e7..aa2fdfe 100644 (file)
@@ -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: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbrtowc = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> 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
index d364b7e..27e06d7 100644 (file)
@@ -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: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbsinit = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> 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
index 025198a..065df92 100644 (file)
@@ -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: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_mbsrtowcs = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> 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
index d21f1b9..be5e815 100644 (file)
@@ -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: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_wcrtomb = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> 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
index 7ce5759..143b1be 100644 (file)
@@ -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: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
+   included before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+]])
+    if test $ac_cv_have_decl_wcsrtombs = yes; then
+      dnl On Minix 3.1.8, the system's <wchar.h> 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