Check-in [ef57276d7c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updated patch for NetBSD compiler, from NixOS project
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ef57276d7c35e798aa75b7706c52dfbbc6932ba7
User & Date: rkeene 2019-05-09 23:10:31
Context
2019-05-09
23:10
Make sure when overwriting files we have permission to do so check-in: 019ff6c17d user: rkeene tags: trunk
23:10
Updated patch for NetBSD compiler, from NixOS project check-in: ef57276d7c user: rkeene tags: trunk
2019-05-08
21:57
NetBSD 8 requires some ctype work check-in: 22acd7c457 user: rkeene tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to patches/gcc/gcc-9.1.0-netbsdctypes.diff.



1
2
3






4

5
6






































































































7



8





9




10

11




12


diff -uNr gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
--- gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h	2019-01-01 06:31:55.000000000 -0600
+++ gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h	2019-05-08 16:44:07.429830428 -0500






@@ -45,7 +45,7 @@

     // on the mask type. Because of this, we don't use an enum.
     typedef unsigned char      	mask;






































































































 



-#ifndef _CTYPE_U





+#ifndef _CTYPE_N




     static const mask upper    	= _U;

     static const mask lower 	= _L;




     static const mask alpha 	= _U | _L;
>
>


|
>
>
>
>
>
>
|
>

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
|
>
>
>
>
>
|
>
>
>
>
|
>
|
>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Fix NetBSD ctypes, from Nix:
    https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/compilers/gcc
diff -uNr gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h
--- gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h	2019-01-01 06:31:55.000000000 -0600
+++ gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h	2019-05-09 14:50:54.011379165 -0500
@@ -38,40 +38,46 @@
   /// @brief  Base class for ctype.
   struct ctype_base
   {
-    // Non-standard typedefs.
-    typedef const unsigned char*	__to_type;
 
     // 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;
 
 #ifndef _CTYPE_U
-    static const mask upper    	= _U;
-    static const mask lower 	= _L;
-    static const mask alpha 	= _U | _L;
-    static const mask digit 	= _N;
-    static const mask xdigit 	= _N | _X;
-    static const mask space 	= _S;
-    static const mask print 	= _P | _U | _L | _N | _B;
-    static const mask graph 	= _P | _U | _L | _N;
-    static const mask cntrl 	= _C;
-    static const mask punct 	= _P;
-    static const mask alnum 	= _U | _L | _N;
+    // Non-standard typedefs.
+    typedef const unsigned char*	__to_type;
+
+    typedef unsigned char	mask;
+
+    static const mask upper	= _U;
+    static const mask lower	= _L;
+    static const mask alpha	= _U | _L;
+    static const mask digit	= _N;
+    static const mask xdigit	= _N | _X;
+    static const mask space	= _S;
+    static const mask print	= _P | _U | _L | _N | _B;
+    static const mask graph	= _P | _U | _L | _N;
+    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;
+    typedef const unsigned short*	__to_type;
+
+    typedef unsigned short	mask;
+
+    static const mask upper	= _CTYPE_U;
+    static const mask lower	= _CTYPE_L;
+    static const mask alpha	= _CTYPE_A;
+    static const mask digit	= _CTYPE_D;
+    static const mask xdigit	= _CTYPE_X;
+    static const mask space	= _CTYPE_S;
+    static const mask print	= _CTYPE_R;
+    static const mask graph	= _CTYPE_G;
+    static const mask cntrl	= _CTYPE_C;
+    static const mask punct	= _CTYPE_P;
+    static const mask alnum	= _CTYPE_A | _CTYPE_D;
 #endif
 #if __cplusplus >= 201103L
-    static const mask blank 	= space;
+    static const mask blank	= space;
 #endif
   };
 
diff -uNr gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc
--- gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc	2019-01-01 06:31:55.000000000 -0600
+++ gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc	2019-05-09 14:50:54.012379165 -0500
@@ -38,11 +38,9 @@
 
 // Information as gleaned from /usr/include/ctype.h
 
-  extern "C" const u_int8_t _C_ctype_[];
-
   const ctype_base::mask*
   ctype<char>::classic_table() throw()
-  { return _C_ctype_ + 1; }
+  { return _C_ctype_tab_ + 1; }
 
   ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
 		     size_t __refs)
@@ -69,14 +67,14 @@
 
   char
   ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
+  { return ::toupper((int)(unsigned char) __c); }
 
   const char*
   ctype<char>::do_toupper(char* __low, const char* __high) const
   {
     while (__low < __high)
       {
-	*__low = ::toupper((int) *__low);
+	*__low = ::toupper((int)(unsigned char) *__low);
 	++__low;
       }
     return __high;
@@ -84,14 +82,14 @@
 
   char
   ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
+  { return ::tolower((int)(unsigned char) __c); }
 
   const char*
   ctype<char>::do_tolower(char* __low, const char* __high) const
   {
     while (__low < __high)
       {
-	*__low = ::tolower((int) *__low);
+	*__low = ::tolower((int)(unsigned char) *__low);
 	++__low;
       }
     return __high;
diff -uNr gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h
--- gcc-9.1.0.orig/libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h	2019-01-01 06:31:55.000000000 -0600
+++ gcc-9.1.0-netbsdctypes/libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h	2019-05-09 14:50:54.029379165 -0500
@@ -48,7 +48,7 @@
   is(const char* __low, const char* __high, mask* __vec) const
   {
     while (__low < __high)
-      *__vec++ = _M_table[*__low++];
+      *__vec++ = _M_table[(unsigned char)*__low++];
     return __high;
   }