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 666d98f077933b12b5accadc20c244a689869cd1..f41fb6534acdafee82e9e0876bc219e353bc47b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+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.
index 884f8cdb4817b854c42702cff771da21c374c3d5..8d6fb2369cda6bb32f59b7019632ff744f812750 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 b9e01e7a0e95d43f7fe865c41e5de8ba4fd70711..aa2fdfe3779af16c9a761de608fda723e9548540 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 d364b7e0fe5bb90887b198d79a339e9fd7661a10..27e06d761bf87e30b7e7b37c3ad6b194e5f059ec 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 025198a91dc380e7d1a4cecbe126ec186cbb50f4..065df928737432fd84ecc1e396f660f05482d0d0 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 d21f1b9a75f23729b3cad772fbfe5c2e6c8a9925..be5e8151e7549f4021325f6d36c8dec5c2e827d5 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 7ce575961571b10ef2c8158e07cfe5c8290aad94..143b1befdf53a92aafcad4db36c62c9bf7294778 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