Burkelium 64bit fixes, and related linux workarounds.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4118 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2012-10-08 05:10:14 +00:00
parent 50f7b34b80
commit 118587329c
2 changed files with 26 additions and 26 deletions

View file

@ -507,7 +507,7 @@ void *Sys_GetGameAPI(void *parms)
else else
snprintf(name, sizeof(name), "%s/%s/%s", curpath, searchpath, agamename); snprintf(name, sizeof(name), "%s/%s/%s", curpath, searchpath, agamename);
game_library = dlopen (name, RTLD_LAZY); game_library = dlopen (name, RTLD_NOW | RTLD_LOCAL);
if (game_library) if (game_library)
{ {
GetGameAPI = (void *)dlsym (game_library, "GetGameAPI"); GetGameAPI = (void *)dlsym (game_library, "GetGameAPI");
@ -541,7 +541,7 @@ dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
lib = dlopen (va("%s.so", name), RTLD_LAZY); lib = dlopen (va("%s.so", name), RTLD_LAZY);
if (!lib) if (!lib)
{ {
Con_DPrintf("module \"%s\" faield - %s\n", name, dlerror()); Con_DPrintf("%s\n", dlerror());
return NULL; return NULL;
} }

View file

@ -238,13 +238,13 @@ static qintptr_t Plug_FindBuiltin(qboolean native, char *p)
return 0; return 0;
} }
qintptr_t VARGS Plug_GetBuiltin(void *offset, quintptr_t mask, const qintptr_t *args) static qintptr_t VARGS Plug_GetBuiltin(void *offset, quintptr_t mask, const qintptr_t *args)
{ {
char *p = (char *)VM_POINTER(args[0]); char *p = (char *)VM_POINTER(args[0]);
return Plug_FindBuiltin(!offset, p); return Plug_FindBuiltin(!offset, p);
} }
int Plug_SystemCallsVM(void *offset, quintptr_t mask, int fn, const int *arg) static int Plug_SystemCallsVM(void *offset, quintptr_t mask, int fn, const int *arg)
{ {
#if FTE_WORDSIZE == 32 #if FTE_WORDSIZE == 32
#define args arg #define args arg
@ -344,7 +344,7 @@ plugin_t *Plug_Load(char *file)
return newplug; return newplug;
} }
int Plug_Emumerated (const char *name, int size, void *param) static int Plug_Emumerated (const char *name, int size, void *param)
{ {
char vmname[MAX_QPATH]; char vmname[MAX_QPATH];
Q_strncpyz(vmname, name, sizeof(vmname)); Q_strncpyz(vmname, name, sizeof(vmname));
@ -355,23 +355,23 @@ int Plug_Emumerated (const char *name, int size, void *param)
return true; return true;
} }
qintptr_t VARGS Plug_Con_Print(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Con_Print(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
// if (qrenderer == QR_NONE) // if (qrenderer == QR_NONE)
// return false; // return false;
Con_Printf("%s", (char*)VM_POINTER(arg[0])); Con_Printf("%s", (char*)VM_POINTER(arg[0]));
return 0; return 0;
} }
qintptr_t VARGS Plug_Sys_Error(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Sys_Error(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
Sys_Error("%s", (char*)offset+arg[0]); Sys_Error("%s", (char*)offset+arg[0]);
return 0; return 0;
} }
qintptr_t VARGS Plug_Sys_Milliseconds(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Sys_Milliseconds(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
return Sys_DoubleTime()*1000; return Sys_DoubleTime()*1000;
} }
qintptr_t VARGS Plug_ExportToEngine(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_ExportToEngine(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *name = (char*)VM_POINTER(arg[0]); char *name = (char*)VM_POINTER(arg[0]);
unsigned int functionid = VM_LONG(arg[1]); unsigned int functionid = VM_LONG(arg[1]);
@ -412,7 +412,7 @@ qintptr_t VARGS Plug_ExportToEngine(void *offset, quintptr_t mask, const qintptr
} }
//retrieve a plugin's name //retrieve a plugin's name
qintptr_t VARGS Plug_GetPluginName(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_GetPluginName(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
int plugnum = VM_LONG(arg[0]); int plugnum = VM_LONG(arg[0]);
plugin_t *plug; plugin_t *plug;
@ -438,7 +438,7 @@ qintptr_t VARGS Plug_GetPluginName(void *offset, quintptr_t mask, const qintptr_
return false; return false;
} }
qintptr_t VARGS Plug_ExportNative(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_ExportNative(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
void *func; void *func;
char *name = (char*)VM_POINTER(arg[0]); char *name = (char*)VM_POINTER(arg[0]);
@ -501,7 +501,7 @@ typedef struct {
int plugincvararraylen; int plugincvararraylen;
plugincvararray_t *plugincvararray; plugincvararray_t *plugincvararray;
//qhandle_t Cvar_Register (char *name, char *defaultval, int flags, char *grouphint); //qhandle_t Cvar_Register (char *name, char *defaultval, int flags, char *grouphint);
qintptr_t VARGS Plug_Cvar_Register(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_Register(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *name = VM_POINTER(arg[0]); char *name = VM_POINTER(arg[0]);
char *defaultvalue = VM_POINTER(arg[1]); char *defaultvalue = VM_POINTER(arg[1]);
@ -530,7 +530,7 @@ qintptr_t VARGS Plug_Cvar_Register(void *offset, quintptr_t mask, const qintptr_
return i; return i;
} }
//int Cvar_Update, (qhandle_t handle, int modificationcount, char *stringv, float *floatv)); //stringv is 256 chars long, don't expect this function to do anything if modification count is unchanged. //int Cvar_Update, (qhandle_t handle, int modificationcount, char *stringv, float *floatv)); //stringv is 256 chars long, don't expect this function to do anything if modification count is unchanged.
qintptr_t VARGS Plug_Cvar_Update(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_Update(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
int handle; int handle;
int modcount; int modcount;
@ -560,7 +560,7 @@ qintptr_t VARGS Plug_Cvar_Update(void *offset, quintptr_t mask, const qintptr_t
} }
//void Cmd_Args(char *buffer, int buffersize) //void Cmd_Args(char *buffer, int buffersize)
qintptr_t VARGS Plug_Cmd_Args(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cmd_Args(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *buffer = (char*)VM_POINTER(arg[0]); char *buffer = (char*)VM_POINTER(arg[0]);
char *args; char *args;
@ -571,7 +571,7 @@ qintptr_t VARGS Plug_Cmd_Args(void *offset, quintptr_t mask, const qintptr_t *ar
return 1; return 1;
} }
//void Cmd_Argv(int num, char *buffer, int buffersize) //void Cmd_Argv(int num, char *buffer, int buffersize)
qintptr_t VARGS Plug_Cmd_Argv(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cmd_Argv(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *buffer = (char*)VM_POINTER(arg[1]); char *buffer = (char*)VM_POINTER(arg[1]);
char *args; char *args;
@ -582,13 +582,13 @@ qintptr_t VARGS Plug_Cmd_Argv(void *offset, quintptr_t mask, const qintptr_t *ar
return 1; return 1;
} }
//int Cmd_Argc(void) //int Cmd_Argc(void)
qintptr_t VARGS Plug_Cmd_Argc(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cmd_Argc(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
return Cmd_Argc(); return Cmd_Argc();
} }
//void Cvar_SetString (char *name, char *value); //void Cvar_SetString (char *name, char *value);
qintptr_t VARGS Plug_Cvar_SetString(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_SetString(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *name = VM_POINTER(arg[0]), char *name = VM_POINTER(arg[0]),
*value = VM_POINTER(arg[1]); *value = VM_POINTER(arg[1]);
@ -603,7 +603,7 @@ qintptr_t VARGS Plug_Cvar_SetString(void *offset, quintptr_t mask, const qintptr
} }
//void Cvar_SetFloat (char *name, float value); //void Cvar_SetFloat (char *name, float value);
qintptr_t VARGS Plug_Cvar_SetFloat(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_SetFloat(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *name = VM_POINTER(arg[0]); char *name = VM_POINTER(arg[0]);
float value = VM_FLOAT(arg[1]); float value = VM_FLOAT(arg[1]);
@ -618,7 +618,7 @@ qintptr_t VARGS Plug_Cvar_SetFloat(void *offset, quintptr_t mask, const qintptr_
} }
//void Cvar_GetFloat (char *name); //void Cvar_GetFloat (char *name);
qintptr_t VARGS Plug_Cvar_GetFloat(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_GetFloat(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *name = VM_POINTER(arg[0]); char *name = VM_POINTER(arg[0]);
int ret; int ret;
@ -633,7 +633,7 @@ qintptr_t VARGS Plug_Cvar_GetFloat(void *offset, quintptr_t mask, const qintptr_
} }
//qboolean Cvar_GetString (char *name, char *retstring, int sizeofretstring); //qboolean Cvar_GetString (char *name, char *retstring, int sizeofretstring);
qintptr_t VARGS Plug_Cvar_GetString(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cvar_GetString(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
char *name, *ret; char *name, *ret;
int retsize; int retsize;
@ -658,7 +658,7 @@ qintptr_t VARGS Plug_Cvar_GetString(void *offset, quintptr_t mask, const qintptr
} }
//void Cmd_AddText (char *text, qboolean insert); //abort the entire engine. //void Cmd_AddText (char *text, qboolean insert); //abort the entire engine.
qintptr_t VARGS Plug_Cmd_AddText(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cmd_AddText(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
if (VM_LONG(arg[1])) if (VM_LONG(arg[1]))
Cbuf_InsertText(VM_POINTER(arg[0]), RESTRICT_LOCAL, false); Cbuf_InsertText(VM_POINTER(arg[0]), RESTRICT_LOCAL, false);
@ -697,7 +697,7 @@ void Plug_Command_f(void)
currentplug = oldplug; currentplug = oldplug;
} }
qintptr_t VARGS Plug_Cmd_AddCommand(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Cmd_AddCommand(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
int i; int i;
char *name = VM_POINTER(arg[0]); char *name = VM_POINTER(arg[0]);
@ -723,7 +723,7 @@ qintptr_t VARGS Plug_Cmd_AddCommand(void *offset, quintptr_t mask, const qintptr
plugincommandarray[i].plugin = currentplug; //worked plugincommandarray[i].plugin = currentplug; //worked
return true; return true;
} }
void VARGS Plug_FreeConCommands(plugin_t *plug) static void VARGS Plug_FreeConCommands(plugin_t *plug)
{ {
int i; int i;
for (i = 0; i < plugincommandarraylen; i++) for (i = 0; i < plugincommandarraylen; i++)
@ -762,7 +762,7 @@ typedef struct {
pluginstream_t *pluginstreamarray; pluginstream_t *pluginstreamarray;
int pluginstreamarraylen; int pluginstreamarraylen;
int Plug_NewStreamHandle(plugstream_e type) static int Plug_NewStreamHandle(plugstream_e type)
{ {
int i; int i;
for (i = 1; i < pluginstreamarraylen; i++) for (i = 1; i < pluginstreamarraylen; i++)
@ -789,7 +789,7 @@ int Plug_NewStreamHandle(plugstream_e type)
#ifndef NACL #ifndef NACL
//EBUILTIN(int, NET_TCPListen, (char *ip, int port, int maxcount)); //EBUILTIN(int, NET_TCPListen, (char *ip, int port, int maxcount));
//returns a new socket with listen enabled. //returns a new socket with listen enabled.
qintptr_t VARGS Plug_Net_TCPListen(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Net_TCPListen(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
int handle; int handle;
int sock; int sock;
@ -865,7 +865,7 @@ qintptr_t VARGS Plug_Net_TCPListen(void *offset, quintptr_t mask, const qintptr_
return handle; return handle;
} }
qintptr_t VARGS Plug_Net_Accept(void *offset, quintptr_t mask, const qintptr_t *arg) static qintptr_t VARGS Plug_Net_Accept(void *offset, quintptr_t mask, const qintptr_t *arg)
{ {
int handle = VM_LONG(arg[0]); int handle = VM_LONG(arg[0]);
struct sockaddr_in address; struct sockaddr_in address;