summaryrefslogtreecommitdiffhomepage
path: root/src/os-unix.h
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-06-12 22:28:53 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-06-12 23:06:47 +0100
commit7aa6bd1cd88db9cceef3d1c07cd7664cb47538be (patch)
treef9db39fedd4ddcc3dc29e370af5b1b9b9894a948 /src/os-unix.h
parent7893ef46f85eb5a6021d6ab763ca84e382e64954 (diff)
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.
Diffstat (limited to 'src/os-unix.h')
-rw-r--r--src/os-unix.h9
1 files changed, 9 insertions, 0 deletions
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__