23 lines
429 B
C
23 lines
429 B
C
|
|
#include "../../include/ground.h"
|
||
|
|
|
||
|
|
#ifdef _WIN32
|
||
|
|
// TODO: Windows support
|
||
|
|
#else
|
||
|
|
#include <dlfcn.h>
|
||
|
|
#endif
|
||
|
|
|
||
|
|
void* _GroundFFIGetFunction(void* handle, char* id) {
|
||
|
|
#ifdef _WIN32
|
||
|
|
// TODO: Windows support
|
||
|
|
#else
|
||
|
|
void* function = dlsym(handle, id);
|
||
|
|
char* error = dlerror();
|
||
|
|
if (error != NULL) {
|
||
|
|
Ground.Log.Error(error);
|
||
|
|
Ground.Flags.error = true;
|
||
|
|
return NULL;
|
||
|
|
}
|
||
|
|
return function;
|
||
|
|
#endif
|
||
|
|
}
|