From: Lennart Poettering Date: Mon, 30 Nov 2020 16:22:35 +0000 (+0100) Subject: dlfcn-util: add DLSYM_ARG() helper X-Git-Tag: v248-rc1~580^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2f03674bc50263833ebc5b79a194cb667c0a244;p=thirdparty%2Fsystemd.git dlfcn-util: add DLSYM_ARG() helper --- diff --git a/src/basic/dlfcn-util.h b/src/basic/dlfcn-util.h index 2c94ed51f34..e0944f3aaf4 100644 --- a/src/basic/dlfcn-util.h +++ b/src/basic/dlfcn-util.h @@ -8,3 +8,9 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(void*, dlclose); int dlsym_many_and_warn(void *dl, int level, ...); + +/* Macro useful for putting together variable/symbol name pairs when calling dlsym_many_and_warn(). Assumes + * that each library symbol to resolve will be placed in a variable with the "sym_" prefix, i.e. a symbol + * "foobar" is loaded into a variable "sym_foobar". */ +#define DLSYM_ARG(arg) \ + &sym_##arg, STRINGIFY(arg)