bug-gnulib
[Top][All Lists]
Advanced

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

iswblank on OSF/1


From: Bruno Haible
Subject: iswblank on OSF/1
Date: Mon, 20 Dec 2010 02:28:51 +0100
User-agent: KMail/1.9.9

Still on OSF/1 5.1, I see this error:

depbase=`echo test-wctype-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; g++ 
-DHAVE_CONFIG_H -I.   -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. -I./..  
-I../gllib -I./../gllib -Wall -mieee   -MT test-wctype-c++.o -MD -MP -MF 
$depbase.Tpo -c -o test-wctype-c++.o test-wctype-c++.cc && mv -f $depbase.Tpo 
$depbase.Po
as0: Error: test-wctype-c++.cc, line 1: Conflicting definition of symbol 
iswblank
*** Exit 1

The reason is the 'inline' function definition in wctype.in.h, which conflicts
with the use of the same symbol as a function pointer. This fixes it.


2010-12-19  Bruno Haible  <address@hidden>

        wctype: Make it work in C++ mode on OSF/1 5.1.
        * lib/wctype.in.h (iswblank): Declare but not define here.
        * lib/iswblank.c: New file, extracted from lib/wctype.in.h.
        * m4/wctype_h.m4 (gl_WCTYPE_H): Arrange to compile it if needed.
        * modules/wctype (Files): Add lib/iswblank.c.

--- lib/wctype.in.h.orig        Mon Dec 20 02:27:18 2010
+++ lib/wctype.in.h     Mon Dec 20 02:27:18 2010
@@ -284,18 +284,10 @@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define iswblank rpl_iswblank
 #  endif
-# endif
-
-static inline int
-# if @REPLACE_ISWBLANK@
-rpl_iswblank
+extern int rpl_iswblank (wint_t wc);
 # else
-iswblank
+extern int iswblank (wint_t wc);
 # endif
-         (wint_t wc)
-{
-  return wc == ' ' || wc == '\t';
-}
 
 #endif
 
--- lib/iswblank.c.orig Tue Apr 14 12:31:40 2009
+++ lib/iswblank.c      Mon Dec 20 02:27:18 2010
@@ -0,0 +1,27 @@
+/* Test wide character for being blank.
+   Copyright (C) 2008-2010 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <wctype.h>
+
+int
+iswblank (wint_t wc)
+{
+  return wc == ' ' || wc == '\t';
+}
--- m4/wctype_h.m4.orig Mon Dec 20 02:27:18 2010
+++ m4/wctype_h.m4      Mon Dec 20 02:27:18 2010
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 8
+# wctype_h.m4 serial 9
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
@@ -82,4 +82,14 @@
     REPLACE_ISWCNTRL=0
   fi
   AC_SUBST([REPLACE_ISWCNTRL])
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+    :
+  else
+    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+      dnl Redefine only iswblank.
+      AC_LIBOBJ([iswblank])
+    fi
+  fi
 ])
--- modules/wctype.orig Mon Dec 20 02:27:18 2010
+++ modules/wctype      Mon Dec 20 02:27:18 2010
@@ -3,6 +3,7 @@
 
 Files:
 lib/wctype.in.h
+lib/iswblank.c
 m4/wctype_h.m4
 m4/wint_t.m4
 



reply via email to

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