This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[libstdc++] Patch: std_cwctype and iswblank


Currently std_cwctype.h uses iswblank, which AFAIK is a GNU extension,
and this causes compilation of anything including cwctype to fail on 
non-GNU OSs.

Shouldn't the platform-specific specific extensions, including the GNU
ones, be guarded?

  $ cat cwctype-bug.cc
  #include <cwctype>

  $ /usr/local/gcc-3.0/bin/gcc -v
  Reading specs from
  /usr/local/gcc-3.0/lib/gcc-lib/sparc-sun-solaris2.8/3.0/specs
  Configured with: ../../gcc-3.0/configure --enable-shared --enable-threads
  --prefix=/usr/local/gcc-3.0 -v --enable-languages=c++,f77,java
  Thread model: posix
  gcc version 3.0

  $ /usr/local/gcc-3.0/bin/gcc -c cwctype-bug.cc
  In file included from /usr/local/gcc-3.0/include/g++-v3/cwctype:31,
		   from cwctype-bug.cc:1:
  /usr/local/gcc-3.0/include/g++-v3/bits/std_cwctype.h:69: `iswblank' not
     declared

2001-06-19  Mumit Khan  <khan@nanotech.wisc.edu>

	* include/c_std/bits/std_cwctype.h (iswblank): Conditionally use.

Index: include/c_std/bits/std_cwctype.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cwctype.h,v
retrieving revision 1.5
diff -u -3 -p -r1.5 std_cwctype.h
--- std_cwctype.h	2001/06/08 23:22:26	1.5
+++ std_cwctype.h	2001/06/19 23:25:28
@@ -66,7 +66,9 @@ namespace std
 
   using ::iswalnum;
   using ::iswalpha;
+#ifdef _GNU_SOURCE
   using ::iswblank;
+#endif
   using ::iswcntrl;
   using ::iswdigit;
   using ::iswgraph;

Regards,
Mumit



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]