summaryrefslogtreecommitdiff
path: root/dev-games/libnw/files/libnw-1.30.02-C23.patch
blob: 984cd10f360549af36c4f0fe748027ef5140742a (plain)
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
https://bugs.gentoo.org/931876
Fix incompatible pointer cast by pointing to hopefully correct struct
member.
Ordering  of {.y,.c} is important so makefile doesn't try and fail to
regenerate autogenerated file we just edited.
--- a/libnw/mdly.y
+++ b/libnw/mdly.y
@@ -214,7 +214,7 @@
 dummynodeelement
 	: token_parent token_string =
 	{
-		cur_Node->parent = $2;
+		cur_Node->parent->name = $2;
 	}
 	| token_position xyz =
 	{
@@ -247,7 +247,7 @@
 trimeshnodeelement
 	: token_parent token_string =
 	{
-		cur_Node->parent = $2;
+		cur_Node->parent->name = $2;
 	}
 	| token_position xyz =
 	{
@@ -359,7 +359,7 @@
 aabbnodeelement
 	: token_parent token_string =
 	{
-		cur_Node->parent = $2;
+		cur_Node->parent->name = $2;
 	}
 	| token_ambient rgb =
 	{
--- a/libnw/mdly.c
+++ b/libnw/mdly.c
@@ -1142,7 +1142,7 @@
 case 22:
 #line 216 "mdly.y"
 {
-		cur_Node->parent = yyvsp[0].string;
+		cur_Node->parent->name = yyvsp[0].string;
 	}
     break;
 case 23:
@@ -1167,7 +1167,7 @@
 case 30:
 #line 249 "mdly.y"
 {
-		cur_Node->parent = yyvsp[0].string;
+		cur_Node->parent->name = yyvsp[0].string;
 	}
     break;
 case 31:
@@ -1294,7 +1294,7 @@
 case 60:
 #line 361 "mdly.y"
 {
-		cur_Node->parent = yyvsp[0].string;
+		cur_Node->parent->name = yyvsp[0].string;
 	}
     break;
 case 61:
Minimum amount of patching to make it compile with C23:
_POSIX_C_SOURCE for fileno and getopt
strings for strncasecmp
--- a/libnw/key.c
+++ b/libnw/key.c
@@ -9,6 +9,7 @@
 # endif
 # include	<string.h>
 #endif
+#include	<strings.h>
 #include	"global.h"
 #include	"key.h"
 #include	"restyp.h"
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,4 +2,4 @@
 
 EXTRA_DIST = README.tech TODO autogen.sh README.License-Torlack Doxyfile.in magic
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/itpdis/Makefile.am
+++ b/itpdis/Makefile.am
@@ -10,4 +10,4 @@
 
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/libnw/Makefile.am
+++ b/libnw/Makefile.am
@@ -18,4 +18,4 @@
 EXTRA_DIST = $(man_MANS) sety.h mdly.h agg_toc_load.3.in agg_toc_del.3.in \
 	agg_create.3.in bif_toc_load.3.in get_game_dir.3.in read_key.3.in
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nw2da2csv/Makefile.am
+++ b/nw2da2csv/Makefile.am
@@ -10,4 +10,4 @@
 
 EXTRA_DIST = $(man_MANS) nw2da2csv.1.in
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwaggext/Makefile.am
+++ b/nwaggext/Makefile.am
@@ -10,4 +10,4 @@
 
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwareamap/Makefile.am
+++ b/nwareamap/Makefile.am
@@ -10,4 +10,4 @@
 
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwmrgplc/Makefile.am
+++ b/nwmrgplc/Makefile.am
@@ -10,4 +10,4 @@
 
 EXTRA_DIST = $(man_MANS) nwmrgplc.1.in
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwresext/Makefile.am
+++ b/nwresext/Makefile.am
@@ -10,4 +10,4 @@
 
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwstrref/Makefile.am
+++ b/nwstrref/Makefile.am
@@ -10,4 +10,4 @@
 
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwtsfix/Makefile.am
+++ b/nwtsfix/Makefile.am
@@ -10,4 +10,4 @@
 
 EXTRA_DIST = $(man_MANS) nwtsfix.1.in
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwtsmerge/Makefile.am
+++ b/nwtsmerge/Makefile.am
@@ -10,4 +10,4 @@
 
 EXTRA_DIST = $(man_MANS) nwtsmerge.1.in
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/nwtsrefs/Makefile.am
+++ b/nwtsrefs/Makefile.am
@@ -10,4 +10,4 @@
 
 EXTRA_DIST = $(man_MANS) nwtsrefs.1.in
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/plistcheck/Makefile.am
+++ b/plistcheck/Makefile.am
@@ -6,4 +6,4 @@
 
 INCLUDES = -I$(top_srcdir)/include
 
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -D_POSIX_C_SOURCE=200809L
--- a/itpdis/main.c
+++ b/itpdis/main.c
@@ -12,6 +12,7 @@
 # endif
 # include	<string.h>
 #endif
+#include	<strings.h>
 #include	"global.h"
 #include	"gamedir.h"
 #include	"itp.h"
--- a/nwmrgplc/main.c
+++ b/nwmrgplc/main.c
@@ -12,6 +12,7 @@
 # endif
 # include	<string.h>
 #endif
+#include        <strings.h>
 #include	"global.h"
 #include	"gamedir.h"
 #include	"2da.h"
--- a/nwtsrefs/main.c
+++ b/nwtsrefs/main.c
@@ -12,6 +12,7 @@
 # endif
 # include	<string.h>
 #endif
+#include	<strings.h>
 #include	<ctype.h>
 #include	"global.h"
 #include	"gamedir.h"