aboutsummaryrefslogtreecommitdiffstats
path: root/community/xbps/moving-_unused-macro-to-_unused_attr.patch
blob: d6f33dd9729a5da253ff571738bafe5d9c51eb2b (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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
From 84545a020ceaa499b8220ae6426325e0f12ce463 Mon Sep 17 00:00:00 2001
From: Breno Leitao <breno.leitao@gmail.com>
Date: Tue, 4 Apr 2017 19:20:02 +0000
Subject: [PATCH] Moving _unused macro to _unused_attr

Currently xbps package fails to build using musl libc because the signal.h
header includes a struct field called _unused, that becomes defined as an
function attribute due to the a CFLAG -D macro definition. This cause the
build to fail.

This patch just rename _unused macro to _unused_attr in order to avoid the
names being clashed.

Signed-off-by: Breno Leitao <breno.leitao@gmail.com>

Index: xbps-0.51/bin/xbps-alternatives/main.c
===================================================================
--- xbps-0.51.orig/bin/xbps-alternatives/main.c
+++ xbps-0.51/bin/xbps-alternatives/main.c
@@ -55,7 +55,7 @@ usage(bool fail)
 }
 
 static int
-state_cb(const struct xbps_state_cb_data *xscd, void *cbd _unused)
+state_cb(const struct xbps_state_cb_data *xscd, void *cbd _unused_attr)
 {
 	bool slog = false;
 
Index: xbps-0.51/bin/xbps-create/main.c
===================================================================
--- xbps-0.51.orig/bin/xbps-create/main.c
+++ xbps-0.51/bin/xbps-create/main.c
@@ -197,7 +197,7 @@ process_one_alternative(const char *altg
 
 
 static void
-process_dict_of_arrays(const char *key _unused, const char *val)
+process_dict_of_arrays(const char *key _unused_attr, const char *val)
 {
 	char *altgrname, *args, *p, *saveptr;
 
@@ -300,7 +300,7 @@ entry_is_conf_file(const char *file)
 }
 
 static int
-ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf _unused)
+ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf _unused_attr)
 {
 	struct xentry *xe = NULL;
 	const char *filep = NULL;
Index: xbps-0.51/bin/xbps-install/main.c
===================================================================
--- xbps-0.51.orig/bin/xbps-install/main.c
+++ xbps-0.51/bin/xbps-install/main.c
@@ -68,7 +68,7 @@ usage(bool fail)
 }
 
 static void
-unpack_progress_cb(const struct xbps_unpack_cb_data *xpd, void *cbdata _unused)
+unpack_progress_cb(const struct xbps_unpack_cb_data *xpd, void *cbdata _unused_attr)
 {
 	if (xpd->entry == NULL || xpd->entry_total_count <= 0)
 		return;
@@ -80,7 +80,7 @@ unpack_progress_cb(const struct xbps_unp
 }
 
 static int
-repo_import_key_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
+repo_import_key_cb(struct xbps_repo *repo, void *arg _unused_attr, bool *done _unused_attr)
 {
 	int rv;
 
Index: xbps-0.51/bin/xbps-install/state_cb.c
===================================================================
--- xbps-0.51.orig/bin/xbps-install/state_cb.c
+++ xbps-0.51/bin/xbps-install/state_cb.c
@@ -32,7 +32,7 @@
 #include "defs.h"
 
 int
-state_cb(const struct xbps_state_cb_data *xscd, void *cbdata _unused)
+state_cb(const struct xbps_state_cb_data *xscd, void *cbdata _unused_attr)
 {
 	xbps_dictionary_t pkgd;
 	const char *instver, *newver;
Index: xbps-0.51/bin/xbps-pkgdb/check.c
===================================================================
--- xbps-0.51.orig/bin/xbps-pkgdb/check.c
+++ xbps-0.51/bin/xbps-pkgdb/check.c
@@ -36,11 +36,11 @@
 #include "defs.h"
 
 static int
-pkgdb_cb(struct xbps_handle *xhp _unused,
+pkgdb_cb(struct xbps_handle *xhp _unused_attr,
 		xbps_object_t obj,
-		const char *key _unused,
+		const char *key _unused_attr,
 		void *arg,
-		bool *done _unused)
+		bool *done _unused_attr)
 {
 	const char *pkgver;
 	char *pkgname;
Index: xbps-0.51/bin/xbps-pkgdb/check_pkg_unneeded.c
===================================================================
--- xbps-0.51.orig/bin/xbps-pkgdb/check_pkg_unneeded.c
+++ xbps-0.51/bin/xbps-pkgdb/check_pkg_unneeded.c
@@ -43,7 +43,7 @@
  * 	  and remove them if that was true.
  */
 int
-check_pkg_unneeded(struct xbps_handle *xhp _unused, const char *pkgname, void *arg)
+check_pkg_unneeded(struct xbps_handle *xhp _unused_attr, const char *pkgname, void *arg)
 {
 	xbps_array_t replaces;
 	xbps_dictionary_t pkgd = arg;
Index: xbps-0.51/bin/xbps-query/list.c
===================================================================
--- xbps-0.51.orig/bin/xbps-query/list.c
+++ xbps-0.51/bin/xbps-query/list.c
@@ -38,11 +38,11 @@ struct list_pkgver_cb {
 };
 
 int
-list_pkgs_in_dict(struct xbps_handle *xhp _unused,
+list_pkgs_in_dict(struct xbps_handle *xhp _unused_attr,
 		  xbps_object_t obj,
-		  const char *key _unused,
+		  const char *key _unused_attr,
 		  void *arg,
-		  bool *loop_done _unused)
+		  bool *loop_done _unused_attr)
 {
 	struct list_pkgver_cb *lpc = arg;
 	const char *pkgver, *short_desc, *state_str;
@@ -88,11 +88,11 @@ list_pkgs_in_dict(struct xbps_handle *xh
 }
 
 int
-list_manual_pkgs(struct xbps_handle *xhp _unused,
+list_manual_pkgs(struct xbps_handle *xhp _unused_attr,
 		 xbps_object_t obj,
-		 const char *key _unused,
-		 void *arg _unused,
-		 bool *loop_done _unused)
+		 const char *key _unused_attr,
+		 void *arg _unused_attr,
+		 bool *loop_done _unused_attr)
 {
 	const char *pkgver;
 	bool automatic = false;
@@ -107,11 +107,11 @@ list_manual_pkgs(struct xbps_handle *xhp
 }
 
 int
-list_hold_pkgs(struct xbps_handle *xhp _unused,
+list_hold_pkgs(struct xbps_handle *xhp _unused_attr,
 		xbps_object_t obj,
-		const char *key _unused,
-		void *arg _unused,
-		bool *loop_done _unused)
+		const char *key _unused_attr,
+		void *arg _unused_attr,
+		bool *loop_done _unused_attr)
 {
 	const char *pkgver;
 
@@ -153,7 +153,7 @@ list_pkgs_pkgdb(struct xbps_handle *xhp)
 }
 
 static int
-repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused, bool *done _unused)
+repo_list_uri_cb(struct xbps_repo *repo, void *arg _unused_attr, bool *done _unused_attr)
 {
 	const char *signedby = NULL;
 	uint16_t pubkeysize = 0;
@@ -201,11 +201,11 @@ struct fflongest {
 };
 
 static int
-_find_longest_pkgver_cb(struct xbps_handle *xhp _unused,
+_find_longest_pkgver_cb(struct xbps_handle *xhp _unused_attr,
 			xbps_object_t obj,
-			const char *key _unused,
+			const char *key _unused_attr,
 			void *arg,
-			bool *loop_done _unused)
+			bool *loop_done _unused_attr)
 {
 	struct fflongest *ffl = arg;
 	const char *pkgver;
Index: xbps-0.51/bin/xbps-query/ownedby.c
===================================================================
--- xbps-0.51.orig/bin/xbps-query/ownedby.c
+++ xbps-0.51/bin/xbps-query/ownedby.c
@@ -95,9 +95,9 @@ match_files_by_pattern(xbps_dictionary_t
 static int
 ownedby_pkgdb_cb(struct xbps_handle *xhp,
 		xbps_object_t obj,
-		const char *obj_key _unused,
+		const char *obj_key _unused_attr,
 		void *arg,
-		bool *done _unused)
+		bool *done _unused_attr)
 {
 	xbps_dictionary_t pkgmetad;
 	xbps_array_t files_keys;
@@ -127,9 +127,9 @@ ownedby_pkgdb_cb(struct xbps_handle *xhp
 static int
 repo_match_cb(struct xbps_handle *xhp,
 		xbps_object_t obj,
-		const char *key _unused,
+		const char *key _unused_attr,
 		void *arg,
-		bool *done _unused)
+		bool *done _unused_attr)
 {
 	xbps_dictionary_t filesd;
 	xbps_array_t files_keys;
@@ -161,7 +161,7 @@ repo_match_cb(struct xbps_handle *xhp,
 }
 
 static int
-repo_ownedby_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
+repo_ownedby_cb(struct xbps_repo *repo, void *arg, bool *done _unused_attr)
 {
 	xbps_array_t allkeys;
 	struct ffdata *ffd = arg;
Index: xbps-0.51/bin/xbps-query/search.c
===================================================================
--- xbps-0.51.orig/bin/xbps-query/search.c
+++ xbps-0.51/bin/xbps-query/search.c
@@ -96,11 +96,11 @@ print_results(struct xbps_handle *xhp, s
 }
 
 static int
-search_array_cb(struct xbps_handle *xhp _unused,
+search_array_cb(struct xbps_handle *xhp _unused_attr,
 		xbps_object_t obj,
-		const char *key _unused,
+		const char *key _unused_attr,
 		void *arg,
-		bool *done _unused)
+		bool *done _unused_attr)
 {
 	xbps_object_t obj2;
 	struct search_data *sd = arg;
@@ -212,7 +212,7 @@ search_array_cb(struct xbps_handle *xhp
 }
 
 static int
-search_repo_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
+search_repo_cb(struct xbps_repo *repo, void *arg, bool *done _unused_attr)
 {
 	xbps_array_t allkeys;
 	struct search_data *sd = arg;
Index: xbps-0.51/bin/xbps-reconfigure/main.c
===================================================================
--- xbps-0.51.orig/bin/xbps-reconfigure/main.c
+++ xbps-0.51/bin/xbps-reconfigure/main.c
@@ -52,7 +52,7 @@ usage(bool fail)
 }
 
 static int
-state_cb(const struct xbps_state_cb_data *xscd, void *cbd _unused)
+state_cb(const struct xbps_state_cb_data *xscd, void *cbd _unused_attr)
 {
 	bool slog = false;
 
Index: xbps-0.51/bin/xbps-remove/clean-cache.c
===================================================================
--- xbps-0.51.orig/bin/xbps-remove/clean-cache.c
+++ xbps-0.51/bin/xbps-remove/clean-cache.c
@@ -38,8 +38,8 @@
 
 static int
 cleaner_cb(struct xbps_handle *xhp, xbps_object_t obj,
-		const char *key _unused, void *arg _unused,
-		bool *done _unused)
+		const char *key _unused_attr, void *arg _unused_attr,
+		bool *done _unused_attr)
 {
 	xbps_dictionary_t repo_pkgd;
 	const char *binpkg, *rsha256;
Index: xbps-0.51/bin/xbps-remove/main.c
===================================================================
--- xbps-0.51.orig/bin/xbps-remove/main.c
+++ xbps-0.51/bin/xbps-remove/main.c
@@ -64,7 +64,7 @@ usage(bool fail)
 }
 
 static int
-state_cb_rm(const struct xbps_state_cb_data *xscd, void *cbdata _unused)
+state_cb_rm(const struct xbps_state_cb_data *xscd, void *cbdata _unused_attr)
 {
 	bool slog = false;
 
Index: xbps-0.51/bin/xbps-rindex/index-clean.c
===================================================================
--- xbps-0.51.orig/bin/xbps-rindex/index-clean.c
+++ xbps-0.51/bin/xbps-rindex/index-clean.c
@@ -43,9 +43,9 @@ static xbps_dictionary_t dest;
 static int
 idx_cleaner_cb(struct xbps_handle *xhp,
 		xbps_object_t obj,
-		const char *key _unused,
+		const char *key _unused_attr,
 		void *arg,
-		bool *done _unused)
+		bool *done _unused_attr)
 {
 	const char *repourl = arg;
 	const char *arch, *pkgver, *sha256;
Index: xbps-0.51/bin/xbps-rindex/remove-obsoletes.c
===================================================================
--- xbps-0.51.orig/bin/xbps-rindex/remove-obsoletes.c
+++ xbps-0.51/bin/xbps-rindex/remove-obsoletes.c
@@ -65,7 +65,7 @@ remove_pkg(const char *repodir, const ch
 }
 
 static int
-cleaner_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key _unused, void *arg, bool *done _unused)
+cleaner_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key _unused_attr, void *arg, bool *done _unused_attr)
 {
 	struct xbps_repo *repo = arg;
 	const char *binpkg;
Index: xbps-0.51/bin/xbps-uchroot/main.c
===================================================================
--- xbps-0.51.orig/bin/xbps-uchroot/main.c
+++ xbps-0.51/bin/xbps-uchroot/main.c
@@ -109,8 +109,8 @@ die(const char *fmt, ...)
 }
 
 static int
-ftw_cb(const char *fpath, const struct stat *sb _unused, int type,
-		struct FTW *ftwbuf _unused)
+ftw_cb(const char *fpath, const struct stat *sb _unused_attr, int type,
+		struct FTW *ftwbuf _unused_attr)
 {
 	int sverrno = 0;
 
Index: xbps-0.51/configure
===================================================================
--- xbps-0.51.orig/configure
+++ xbps-0.51/configure
@@ -192,7 +192,7 @@ echo "CPPFLAGS +=	-DXBPS_SYSCONF_PATH=\\
 echo "CPPFLAGS +=	-DXBPS_SYSDEFCONF_PATH=\\\"${SHAREDIR}/xbps.d\\\"" >>$CONFIG_MK
 echo "CPPFLAGS +=	-DXBPS_VERSION=\\\"${VERSION}\\\"" >>$CONFIG_MK
 echo "CPPFLAGS +=	-DXBPS_META_PATH=\\\"${DBDIR}\\\"" >>$CONFIG_MK
-echo "CPPFLAGS +=	-D_unused=\"__attribute__((__unused__))\"" >>$CONFIG_MK
+echo "CPPFLAGS +=	-D_unused_attr=\"__attribute__((__unused__))\"" >>$CONFIG_MK
 
 if [ -d .git ]; then
 	_gitrev=$(git rev-parse --short HEAD)
Index: xbps-0.51/lib/package_orphans.c
===================================================================
--- xbps-0.51.orig/lib/package_orphans.c
+++ xbps-0.51/lib/package_orphans.c
@@ -60,7 +60,7 @@
  */
 
 xbps_array_t
-xbps_find_pkg_orphans(struct xbps_handle *xhp, xbps_array_t orphans_user _unused)
+xbps_find_pkg_orphans(struct xbps_handle *xhp, xbps_array_t orphans_user _unused_attr)
 {
 	xbps_array_t rdeps, reqby, array = NULL;
 	xbps_dictionary_t pkgd, deppkgd;
Index: xbps-0.51/lib/plist_fetch.c
===================================================================
--- xbps-0.51.orig/lib/plist_fetch.c
+++ xbps-0.51/lib/plist_fetch.c
@@ -46,7 +46,7 @@ struct fetch_archive {
 };
 
 static int
-fetch_archive_open(struct archive *a _unused, void *client_data)
+fetch_archive_open(struct archive *a _unused_attr, void *client_data)
 {
 	struct fetch_archive *f = client_data;
 
@@ -59,7 +59,7 @@ fetch_archive_open(struct archive *a _un
 }
 
 static ssize_t
-fetch_archive_read(struct archive *a _unused, void *client_data, const void **buf)
+fetch_archive_read(struct archive *a _unused_attr, void *client_data, const void **buf)
 {
 	struct fetch_archive *f = client_data;
 
@@ -68,7 +68,7 @@ fetch_archive_read(struct archive *a _un
 }
 
 static int
-fetch_archive_close(struct archive *a _unused, void *client_data)
+fetch_archive_close(struct archive *a _unused_attr, void *client_data)
 {
 	struct fetch_archive *f = client_data;
 
Index: xbps-0.51/lib/rpool.c
===================================================================
--- xbps-0.51.orig/lib/rpool.c
+++ xbps-0.51/lib/rpool.c
@@ -120,7 +120,7 @@ xbps_rpool_get_repo(const char *url)
 }
 
 void
-xbps_rpool_release(struct xbps_handle *xhp _unused)
+xbps_rpool_release(struct xbps_handle *xhp _unused_attr)
 {
 	struct xbps_repo *repo;
 
@@ -195,7 +195,7 @@ find_pkg_cb(struct xbps_repo *repo, void
 }
 
 static int
-find_pkg_revdeps_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
+find_pkg_revdeps_cb(struct xbps_repo *repo, void *arg, bool *done _unused_attr)
 {
 	struct rpool_fpkg *rpf = arg;
 	xbps_array_t revdeps = NULL;
@@ -216,7 +216,7 @@ find_pkg_revdeps_cb(struct xbps_repo *re
 }
 
 static int
-find_best_pkg_cb(struct xbps_repo *repo, void *arg, bool *done _unused)
+find_best_pkg_cb(struct xbps_repo *repo, void *arg, bool *done _unused_attr)
 {
 	struct rpool_fpkg *rpf = arg;
 	xbps_dictionary_t pkgd;
Index: xbps-0.51/lib/transaction_conflicts.c
===================================================================
--- xbps-0.51.orig/lib/transaction_conflicts.c
+++ xbps-0.51/lib/transaction_conflicts.c
@@ -148,7 +148,7 @@ pkg_conflicts_trans(struct xbps_handle *
 
 static int
 pkgdb_conflicts_cb(struct xbps_handle *xhp, xbps_object_t obj,
-		const char *key _unused, void *arg, bool *done _unused)
+		const char *key _unused_attr, void *arg, bool *done _unused_attr)
 {
 	xbps_array_t pkg_cflicts, trans_cflicts, pkgs = arg;
 	xbps_dictionary_t pkgd;