#1083196 sys/tree.h: stop referencing __unused, which is not defined

Package:
libbsd0
Source:
libbsd0
Description:
utility functions from BSD systems - shared library
Submitter:
Michael Gold
Date:
2024-10-03 00:06:02 UTC
Severity:
normal
#1083196#5
Date:
2024-10-02 23:53:39 UTC
From:
To:
sys/cdefs.h from libbsd neglects to define __unused, with this comment:
	/* Linux headers define a struct with a member names __unused.
	 * Debian bugs: #522773 (linux), #522774 (libc).
	 * Disable for now. */

One of those reports has been closed for about 9 years, and the other is
marked "wontfix".  sys/tree.h still refers to the macro, which can cause
non-obvious error messages:
	In file included from test.c:3:
	test.c:29:1: error: expected ‘;’ before ‘static’
	   29 | RB_PROTOTYPE_STATIC(tree_head, tree_node, rb_entry, tree_node_cmp);
	      | ^~~~~~~~~~~~~~~~~~~

I don't see any particular reason why it has to use the exact macro name
used on BSD; so, I recommend replacing all references with LIBBSD_UNUSED
and re-enabling the part of cdefs.h that would define it.

(If the name "__unused" later becomes available, and anyone still cares,
a "#define __unused LIBBSD_UNUSED" can be added.)