Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Nov 2024 05:20:34 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d7214577ff00 - main - rtld: make it easier to add sparce non-default members to ld_env_var_desc
Message-ID:  <202411070520.4A75KYrK014525@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=d7214577ff00221ac84a85e61794a5e126b952dd

commit d7214577ff00221ac84a85e61794a5e126b952dd
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-01 19:20:17 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-07 05:14:38 +0000

    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
---
 libexec/rtld-elf/rtld.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index c670ec7f0009..7c61fec44ef7 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -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),



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411070520.4A75KYrK014525>