Browse Source

MSVC & Win32 related fixes

pull/2/head
Alibek Omarov 6 years ago
parent
commit
473810fc0c
  1. 1
      common/port.h
  2. 2
      engine/common/lib_common.c
  3. 1
      engine/eiface.h
  4. 2
      engine/platform/win32/win_lib.c
  5. 1
      game_launch/game.cpp

1
common/port.h

@ -118,6 +118,7 @@ GNU General Public License for more details. @@ -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

2
engine/common/lib_common.c

@ -48,7 +48,7 @@ void *COM_FunctionFromName_SR( void *hInstance, const char *pName ) @@ -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;
}

1
engine/eiface.h

@ -390,6 +390,7 @@ typedef struct @@ -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;

2
engine/platform/win32/win_lib.c

@ -950,7 +950,7 @@ const char *COM_NameForFunction( void *hInstance, void *function ) @@ -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];
}

1
game_launch/game.cpp

@ -36,6 +36,7 @@ GNU General Public License for more details. @@ -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…
Cancel
Save