wctype: Avoid compilation error on IRIX 6.5.30.
authorBruno Haible <bruno@clisp.org>
Thu, 2 Sep 2010 09:15:39 +0000 (11:15 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 2 Sep 2010 09:17:10 +0000 (11:17 +0200)
* lib/wctype.in.h (iswblank): Declare with a replacement if
REPLACE_ISWBLANK is set.
* m4/wctype_h.m4 (gl_WCTYPE_H): Check also whether iswblank is
declared. Set REPLACE_ISWBLANK.
* modules/wctype (Makefile.am): Substitute REPLACE_ISWBLANK.
* doc/posix-functions/iswblank.texi: Mention the IRIX 6.5.30 problem.
* doc/posix-headers/wctype.texi: Likewise.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.

ChangeLog
doc/posix-functions/iswblank.texi
doc/posix-headers/wctype.texi
lib/wctype.in.h
m4/wctype_h.m4
modules/wctype

index f0316e6..edb5ab5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-02  Bruno Haible  <bruno@clisp.org>
+
+       wctype: Avoid compilation error on IRIX 6.5.30.
+       * lib/wctype.in.h (iswblank): Declare with a replacement if
+       REPLACE_ISWBLANK is set.
+       * m4/wctype_h.m4 (gl_WCTYPE_H): Check also whether iswblank is
+       declared. Set REPLACE_ISWBLANK.
+       * modules/wctype (Makefile.am): Substitute REPLACE_ISWBLANK.
+       * doc/posix-functions/iswblank.texi: Mention the IRIX 6.5.30 problem.
+       * doc/posix-headers/wctype.texi: Likewise.
+       Reported by Tom G. Christensen <tgc@jupiterrise.com>.
+
 2010-09-01  Bruno Haible  <bruno@clisp.org>
 
        New module 'socketlib'.
index 8c44aa3..453558e 100644 (file)
@@ -12,6 +12,9 @@ Portability problems fixed by Gnulib:
 This function is missing on some platforms:
 AIX 4.3.2, IRIX 6.5, OSF/1 5.1, Solaris 9, mingw.
 @item
+This function is declared but not defined on some platforms:
+IRIX 6.5.30.
+@item
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
 @end itemize
index 8f92e5c..109deac 100644 (file)
@@ -20,6 +20,9 @@ IRIX 5.3.
 The functions @code{isw*} are missing on some platforms:
 FreeBSD 4.11.
 @item
+The function @code{iswblank} is declared but not defined on some platforms:
+IRIX 6.5.30.
+@item
 The functions @code{isw*} are actually defined as macros that don't work,
 on IRIX 5.3.
 @end itemize
index 6782478..e5d26af 100644 (file)
@@ -276,11 +276,22 @@ towupper
   return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
 }
 
-#elif ! @HAVE_ISWBLANK@
+#elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@
 /* Only the iswblank function is missing.  */
 
+# if @REPLACE_ISWBLANK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iswblank rpl_iswblank
+#  endif
+# endif
+
 static inline int
-iswblank (wint_t wc)
+# if @REPLACE_ISWBLANK@
+rpl_iswblank
+# else
+iswblank
+# endif
+         (wint_t wc)
 {
   return wc == ' ' || wc == '\t';
 }
@@ -338,7 +349,11 @@ _GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
 #else
 _GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
 _GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+# if @REPLACE_ISWBLANK@
+_GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
+# else
 _GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
+# endif
 _GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
 _GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
 _GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
index 3292451..7323e54 100644 (file)
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 6
+# wctype_h.m4 serial 7
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
@@ -21,12 +21,21 @@ AC_DEFUN([gl_WCTYPE_H],
   fi
   AC_SUBST([HAVE_ISWCNTRL])
   AC_CHECK_FUNCS_ONCE([iswblank])
+  AC_CHECK_DECLS_ONCE([iswblank])
   if test $ac_cv_func_iswblank = yes; then
     HAVE_ISWBLANK=1
+    REPLACE_HAVE_ISWBLANK=0
   else
     HAVE_ISWBLANK=0
+    if test $ac_cv_have_decl_iswblank = yes; then
+      REPLACE_HAVE_ISWBLANK=1
+    else
+      REPLACE_HAVE_ISWBLANK=0
+    fi
   fi
   AC_SUBST([HAVE_ISWBLANK])
+  AC_SUBST([REPLACE_ISWBLANK])
+
   AC_CHECK_HEADERS_ONCE([wctype.h])
   AC_REQUIRE([AC_C_INLINE])
 
index b212e35..b6407c4 100644 (file)
@@ -29,6 +29,7 @@ wctype.h: wctype.in.h $(CXXDEFS_H) $(WARN_ON_USE_H)
              -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
+             -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \