Patchwork [v3] fix libstdc++/47045

login
register
mail settings
Submitter Jonathan Wakely
Date Jan. 13, 2011, 12:02 a.m.
Message ID <AANLkTimppW0ZUBSvUVUtV1vESOyGZS32cPgRfLipM_x5@mail.gmail.com>
Download mbox | patch
Permalink /patch/78626/
State New
Headers show

Comments

Jonathan Wakely - Jan. 13, 2011, 12:02 a.m.
2011-01-13  Jonathan Wakely  <jwakely.gcc@gmail.com>

        PR libstdc++/47045
        * config/os/bsd/netbsd/ctype_base.h: Use new macros based on version.


Bootstrapped on x86_64/netbsd (with patch from PR 47147 needed to fix
bootstrap on NetBSD). committed to trunk.

Patch

Index: config/os/bsd/netbsd/ctype_base.h
===================================================================
--- config/os/bsd/netbsd/ctype_base.h	(revision 168649)
+++ config/os/bsd/netbsd/ctype_base.h	(working copy)
@@ -31,6 +31,8 @@ 
 //   anoncvs@anoncvs.netbsd.org:/cvsroot/basesrc/include/ctype.h
 // See www.netbsd.org for details of access.
   
+#include <sys/param.h>
+
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
   /// @brief  Base class for ctype.
@@ -42,6 +44,8 @@  _GLIBCXX_BEGIN_NAMESPACE(std)
     // NB: Offsets into ctype<char>::_M_table force a particular size
     // on the mask type. Because of this, we don't use an enum.
     typedef unsigned char      	mask;
+
+#if __NetBSD_Version__ < 599004100
     static const mask upper    	= _U;
     static const mask lower 	= _L;
     static const mask alpha 	= _U | _L;
@@ -53,6 +57,19 @@  _GLIBCXX_BEGIN_NAMESPACE(std)
     static const mask cntrl 	= _C;
     static const mask punct 	= _P;
     static const mask alnum 	= _U | _L | _N;
+#else
+    static const mask upper    	= _CTYPE_U;
+    static const mask lower 	= _CTYPE_L;
+    static const mask alpha 	= _CTYPE_U | _CTYPE_L;
+    static const mask digit 	= _CTYPE_N;
+    static const mask xdigit 	= _CTYPE_N | _CTYPE_X;
+    static const mask space 	= _CTYPE_S;
+    static const mask print 	= _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B;
+    static const mask graph 	= _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N;
+    static const mask cntrl 	= _CTYPE_C;
+    static const mask punct 	= _CTYPE_P;
+    static const mask alnum 	= _CTYPE_U | _CTYPE_L | _CTYPE_N;
+#endif
   };
 
 _GLIBCXX_END_NAMESPACE