From 7aa6bd1cd88db9cceef3d1c07cd7664cb47538be Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 12 Jun 2023 22:28:53 +0100 Subject: Remove the terrible gameinfo.txt garbage at last This also tidies up library handle grabbing with more os.h stuff, and improves the VDF creation logic - since we no longer store a couple of paths which makes it necessary to change that a bit anyway. --- src/os-unix.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/os-unix.h') diff --git a/src/os-unix.h b/src/os-unix.h index ec9a940..a25d8ed 100644 --- a/src/os-unix.h +++ b/src/os-unix.h @@ -39,10 +39,19 @@ typedef char os_char; #define os_getenv getenv #define os_getcwd getcwd +#define OS_DLPREFIX "lib" #define OS_DLSUFFIX ".so" #define OS_MAIN main +static inline void *os_dlopen(const char *name) { + return dlopen(name, RTLD_NOW); +} +static inline void *os_dlhandle(const char *name) { + void *ret = dlopen(name, RTLD_NOW | RTLD_NOLOAD); + if (ret) dlclose(ret); + return ret; +} #define os_dlsym dlsym #ifdef __linux__ -- cgit v1.2.3