more fixes
This commit is contained in:
parent
cd27688a83
commit
b3d0609810
@ -1,3 +1,5 @@
|
||||
#pragma attribute(push, nogc, nothrow)
|
||||
|
||||
#ifdef __linux__
|
||||
# include <xcb/xcb.h>
|
||||
# include <X11/Xlib.h>
|
||||
|
||||
@ -23,6 +23,39 @@ const DEFAULT_ALIGNMENT = (void *).sizeof * 2;
|
||||
version(linux)
|
||||
{
|
||||
import core.sys.posix.sys.mman;
|
||||
import core.sys.posix.dlfcn;
|
||||
|
||||
struct Library
|
||||
{
|
||||
void* ptr;
|
||||
};
|
||||
|
||||
struct Function
|
||||
{
|
||||
void* ptr;
|
||||
};
|
||||
|
||||
Library LoadLibrary(string name)
|
||||
{
|
||||
Library lib = {
|
||||
ptr: null,
|
||||
};
|
||||
|
||||
lib.ptr = dlopen(name.ptr, RTLD_NOW);
|
||||
|
||||
return lib;
|
||||
};
|
||||
|
||||
Function LoadFunction(Library lib, string name)
|
||||
{
|
||||
Function fn = {
|
||||
ptr: null,
|
||||
};
|
||||
|
||||
fn.ptr = dlsym(lib.ptr, name.ptr);
|
||||
|
||||
return fn;
|
||||
};
|
||||
|
||||
void*
|
||||
MemAlloc(u64 size)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user