2
0
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:
Alibek Omarov 2018-06-14 20:32:31 +03:00
parent d0ff201da2
commit 473810fc0c
5 changed files with 5 additions and 2 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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;

View File

@ -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];
}

View File

@ -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