|
|
@ -726,6 +726,22 @@ DFhackCExport uint32_t SDL_ThreadID(void)
|
|
|
|
return _SDL_ThreadID();
|
|
|
|
return _SDL_ThreadID();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static char* (*_SDL_getenv)(const char *name) = 0;
|
|
|
|
|
|
|
|
DFhackCExport char* SDL_getenv(const char *name)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!inited)
|
|
|
|
|
|
|
|
FirstCall();
|
|
|
|
|
|
|
|
return _SDL_getenv(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static size_t (*_SDL_strlcat)(char *dst, const char *src, size_t maxlen) = 0;
|
|
|
|
|
|
|
|
DFhackCExport size_t SDL_strlcat(char *dst, const char *src, size_t maxlen)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(!inited)
|
|
|
|
|
|
|
|
FirstCall();
|
|
|
|
|
|
|
|
return _SDL_strlcat(dst, src, maxlen);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME: this has to be thread-safe.
|
|
|
|
// FIXME: this has to be thread-safe.
|
|
|
|
bool FirstCall()
|
|
|
|
bool FirstCall()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -813,6 +829,10 @@ bool FirstCall()
|
|
|
|
_SDL_SemWait = (int (*)(void *))GetProcAddress(realSDLlib,"SDL_SemWait");
|
|
|
|
_SDL_SemWait = (int (*)(void *))GetProcAddress(realSDLlib,"SDL_SemWait");
|
|
|
|
_SDL_ThreadID = (uint32_t (*)(void))GetProcAddress(realSDLlib,"SDL_ThreadID");
|
|
|
|
_SDL_ThreadID = (uint32_t (*)(void))GetProcAddress(realSDLlib,"SDL_ThreadID");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// new in DF 0.43.05
|
|
|
|
|
|
|
|
_SDL_getenv = (char* (*)(const char*))GetProcAddress(realSDLlib,"SDL_getenv");
|
|
|
|
|
|
|
|
_SDL_strlcat = (size_t (*)(char*, const char*, size_t))GetProcAddress(realSDLlib,"SDL_strlcat");
|
|
|
|
|
|
|
|
|
|
|
|
_SDL_EnableUNICODE(1);
|
|
|
|
_SDL_EnableUNICODE(1);
|
|
|
|
|
|
|
|
|
|
|
|
fprintf(stderr,"Initized HOOKS!\n");
|
|
|
|
fprintf(stderr,"Initized HOOKS!\n");
|
|
|
|