Replace dlmopen by dlopen

This makes builds without glibc (e.g. on Alpine linux) possible.
master
Elias Fleckenstein 2021-12-19 17:40:00 +01:00
parent 125e7eca1a
commit 207ea9b245
No known key found for this signature in database
GPG Key ID: 06927A5199D6C9B2
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
all: dungeon plugins
dungeon: dungeon.c
cc -g -o dungeon dungeon.c -ldl -D_GNU_SOURCE
cc -g -o dungeon dungeon.c -ldl
include plugins/*/Makefile

View File

@ -41,7 +41,7 @@ static void *load_plugin(const char *name)
char library_name[1 + 1 + 7 + 1 + len + 1 + len + 1 + 2 + 1];
sprintf(library_name, "./plugins/%s/%s.so", name, name);
void *handle = dlmopen(LM_ID_BASE, library_name, RTLD_NOW | RTLD_GLOBAL);
void *handle = dlopen(library_name, RTLD_NOW | RTLD_GLOBAL);
if (! handle) {
printf("%s\n", dlerror());