mirror of
https://github.com/autc04/Retro68.git
synced 2024-09-08 05:54:40 +00:00
18 lines
535 B
D
18 lines
535 B
D
import core.runtime;
|
|
import core.stdc.string;
|
|
import core.sys.posix.dlfcn;
|
|
|
|
extern(C) alias RunDepTests = int function(const char*);
|
|
|
|
void main(string[] args)
|
|
{
|
|
auto name = args[0] ~ '\0';
|
|
const pathlen = strrchr(name.ptr, '/') - name.ptr + 1;
|
|
auto root = name[0 .. pathlen];
|
|
auto libloaddep = root ~ "libloaddep.so";
|
|
auto h = Runtime.loadLibrary(libloaddep);
|
|
auto runDepTests = cast(RunDepTests)dlsym(h, "runDepTests");
|
|
assert(runDepTests((root ~ "lib.so\0").ptr));
|
|
assert(Runtime.unloadLibrary(h));
|
|
}
|