mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-11 13:29:12 +01:00
MSVC & Win32 related fixes
This commit is contained in:
parent
d0ff201da2
commit
473810fc0c
@ -118,6 +118,7 @@ GNU General Public License for more details.
|
||||
#define strncasecmp _strnicmp
|
||||
#define open _open
|
||||
#define read _read
|
||||
#define alloca _alloca
|
||||
|
||||
// shut-up compiler warnings
|
||||
#pragma warning(disable : 4244) // MIPS
|
||||
|
@ -48,7 +48,7 @@ void *COM_FunctionFromName_SR( void *hInstance, const char *pName )
|
||||
const char *COM_OffsetNameForFunction( void *function )
|
||||
{
|
||||
static string sname;
|
||||
Q_snprintf( sname, MAX_STRING, "ofs:%d", (int)(void*)(function - (void*)svgame.dllFuncs.pfnGameInit) );
|
||||
Q_snprintf( sname, MAX_STRING, "ofs:%d", (size_t)((byte*)function - (byte*)svgame.dllFuncs.pfnGameInit) );
|
||||
MsgDev( D_NOTE, "COM_OffsetNameForFunction %s\n", sname );
|
||||
return sname;
|
||||
}
|
||||
|
@ -390,6 +390,7 @@ typedef struct
|
||||
short flags;
|
||||
} TYPEDESCRIPTION;
|
||||
|
||||
#undef ARRAYSIZE
|
||||
#define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0]))
|
||||
|
||||
typedef struct playermove_s playermove_t;
|
||||
|
@ -950,7 +950,7 @@ const char *COM_NameForFunction( void *hInstance, void *function )
|
||||
{
|
||||
index = hInst->ordinals[i];
|
||||
|
||||
if(( function - hInst->funcBase ) == hInst->funcs[index] )
|
||||
if(( (char*)function - (char*)hInst->funcBase ) == hInst->funcs[index] )
|
||||
return hInst->names[i];
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@ GNU General Public License for more details.
|
||||
#else
|
||||
#define XASHLIB "xash_dedicated.dll"
|
||||
#endif
|
||||
#define dlerror() GetStringLastError()
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user