rtld: make it easier to add sparce non-default members to ld_env_var_desc

by making the LD_ENV_DESC() macro variadic.

Suggested by:	brooks
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47351
This commit is contained in:
Konstantin Belousov 2024-11-01 21:20:17 +02:00
parent 450e684e0f
commit d7214577ff

View File

@ -348,8 +348,11 @@ struct ld_env_var_desc {
const char *val;
const bool unsecure:1;
};
#define LD_ENV_DESC(var, unsec) \
[LD_##var] = { .n = #var, .unsecure = unsec }
#define LD_ENV_DESC(var, unsec, ...) \
[LD_##var] = { \
.n = #var, \
.unsecure = unsec, \
__VA_ARGS__ \
static struct ld_env_var_desc ld_env_vars[] = {
LD_ENV_DESC(BIND_NOW, false),