wctype: Make it work in C++ mode on OSF/1 5.1.
authorBruno Haible <bruno@clisp.org>
Mon, 20 Dec 2010 01:18:07 +0000 (02:18 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 20 Dec 2010 01:26:33 +0000 (02:26 +0100)
* 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.

ChangeLog
lib/iswblank.c [new file with mode: 0644]
lib/wctype.in.h
m4/wctype_h.m4
modules/wctype

index 43dc38e4197fd22880a76597a476e2cc50a08a2b..f9020abed9616bf99217e9fd21f62e373b3bed93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-12-19  Bruno Haible  <bruno@clisp.org>
+
+       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.
+
 2010-12-19  Bruno Haible  <bruno@clisp.org>
 
        signal: Document problem with type of SIGRTMIN, SIGRTMAX on OSF/1 5.1.
diff --git a/lib/iswblank.c b/lib/iswblank.c
new file mode 100644 (file)
index 0000000..386c014
--- /dev/null
@@ -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';
+}
index 1f209f3370b429da563fff3e79114d3839b78b2e..9a6209895fdaa23a716f83f7dff5b9984eb2a46f 100644 (file)
@@ -284,18 +284,10 @@ towupper
 #  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
 
index bc6b6e791438c81de55e934b305bdd51dbe0e44c..edcf41f989d5fb2a70395e15df7a2182960c3362 100644 (file)
@@ -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 @@ AC_DEFUN([gl_WCTYPE_H],
     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
 ])
index b0fc26d09f3c068db328d0f3a51b7a395fd6a5e8..99dbe44a55b7552c7a90f002dcd493e89799ea7d 100644 (file)
@@ -3,6 +3,7 @@ A <wctype.h> that conforms better to C99.
 
 Files:
 lib/wctype.in.h
+lib/iswblank.c
 m4/wctype_h.m4
 m4/wint_t.m4