bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iswblank failure


From: Bruno Haible
Subject: Re: iswblank failure
Date: Thu, 2 Sep 2010 11:17:59 +0200
User-agent: KMail/1.9.9

Hi Eric,

Eric Blake wrote:
> >> Also, that
> >> particular declaration at line 585 of wctype.h (line 282 of wctype.in.h)
> >> is guarded by:
> >>
> >> #if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
> >> #elif ! @HAVE_ISWBLANK@
> >>
> >> So knowing the value of all the HAVE_IS* and REPLACE_IS* from config.log
> >> would be useful to help diagnose what is going wrong here.
> 
> HAVE_ISWCNTRL 1
> HAVE_ISWBLANK 0
> no definition for REPLACE_ISWBLANK
> 
> sounds like the m4 test needs to be taught to look for a declaration, 
> and if one exists, then line 283 of wctype.in.h needs to key off of 
> REPLACE_ISWBLANK and declare rpl_iswblank in that case.
> 
> Bruno, is this something you can do quickly?

Yes, this makes sense to me. Thanks for the analysis. I'm applying this. But
since it's written in a hurry, please review it and test it.


2010-09-02  Bruno Haible  <address@hidden>

        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 <address@hidden>.

--- doc/posix-functions/iswblank.texi.orig      Thu Sep  2 11:09:42 2010
+++ doc/posix-functions/iswblank.texi   Thu Sep  2 11:05:55 2010
@@ -12,6 +12,9 @@
 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.
address@hidden
 This function returns 0 for all possible arguments on some platforms:
 Linux libc5.
 @end itemize
--- doc/posix-headers/wctype.texi.orig  Thu Sep  2 11:09:42 2010
+++ doc/posix-headers/wctype.texi       Thu Sep  2 11:05:31 2010
@@ -20,6 +20,9 @@
 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.
address@hidden
 The functions @code{isw*} are actually defined as macros that don't work,
 on IRIX 5.3.
 @end itemize
--- lib/wctype.in.h.orig        Thu Sep  2 11:09:42 2010
+++ lib/wctype.in.h     Thu Sep  2 11:09:02 2010
@@ -276,11 +276,22 @@
   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 @@
 #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));
--- m4/wctype_h.m4.orig Thu Sep  2 11:09:42 2010
+++ m4/wctype_h.m4      Thu Sep  2 11:03:04 2010
@@ -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 @@
   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])
 
--- modules/wctype.orig Thu Sep  2 11:09:42 2010
+++ modules/wctype      Thu Sep  2 11:04:25 2010
@@ -29,6 +29,7 @@
              -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)' \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]