Browse Source

Fix MinGW build

pull/2/head
lewa_j 7 years ago
parent
commit
43b746d2f8
  1. 3
      engine/common/common.h
  2. 8
      engine/common/net_ws.c
  3. 10
      engine/common/system.c
  4. 3
      engine/platform/sdl/vid_sdl.c
  5. 4
      engine/platform/win32/win_con.c
  6. 4
      engine/platform/win32/win_lib.c

3
engine/common/common.h

@ -425,7 +425,8 @@ typedef struct @@ -425,7 +425,8 @@ typedef struct
typedef struct host_parm_s
{
HINSTANCE hInst;
HANDLE hMutex;
host_status_t status; // global host state
game_status_t game; // game manager
uint type; // running at

8
engine/common/net_ws.c

@ -103,6 +103,11 @@ static dllfunc_t winsock_funcs[] = @@ -103,6 +103,11 @@ static dllfunc_t winsock_funcs[] =
dll_info_t winsock_dll = { "wsock32.dll", winsock_funcs, false };
static void (_stdcall *pInitializeCriticalSection)( void* );
static void (_stdcall *pEnterCriticalSection)( void* );
static void (_stdcall *pLeaveCriticalSection)( void* );
static void (_stdcall *pDeleteCriticalSection)( void* );
static dllfunc_t kernel32_funcs[] =
{
{ "InitializeCriticalSection", (void **) &pInitializeCriticalSection },
@ -1429,9 +1434,10 @@ void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to @@ -1429,9 +1434,10 @@ void NET_SendPacket( netsrc_t sock, size_t length, const void *data, netadr_t to
if( NET_IsSocketError( ret ))
{
int err = 0;
{
#ifdef _WIN32
int err = pWSAGetLastError();
err = pWSAGetLastError();
// WSAEWOULDBLOCK is silent
if( err == WSAEWOULDBLOCK )

10
engine/common/system.c

@ -538,7 +538,7 @@ void Sys_WaitForQuit( void ) @@ -538,7 +538,7 @@ void Sys_WaitForQuit( void )
#ifdef _WIN32
MSG msg;
Con_RegisterHotkeys();
Wcon_RegisterHotkeys();
msg.message = 0;
@ -616,8 +616,8 @@ void Sys_Error( const char *error, ... ) @@ -616,8 +616,8 @@ void Sys_Error( const char *error, ... )
if( host_developer.value )
{
#ifdef _WIN32
Con_ShowConsole( true );
Con_DisableInput(); // disable input line for dedicated server
Wcon_ShowConsole( true );
Wcon_DisableInput(); // disable input line for dedicated server
#endif
Sys_Print( text ); // print error message
Sys_WaitForQuit();
@ -625,7 +625,7 @@ void Sys_Error( const char *error, ... ) @@ -625,7 +625,7 @@ void Sys_Error( const char *error, ... )
else
{
#ifdef _WIN32
Con_ShowConsole( false );
Wcon_ShowConsole( false );
#endif
MSGBOX( text );
}
@ -730,7 +730,7 @@ void Sys_Print( const char *pMsg ) @@ -730,7 +730,7 @@ void Sys_Print( const char *pMsg )
*b = *c = 0; // terminator
Con_WinPrint( buffer );
Wcon_WinPrint( buffer );
}
#endif

3
engine/platform/sdl/vid_sdl.c

@ -302,7 +302,7 @@ static void WIN_SetDPIAwareness( void ) @@ -302,7 +302,7 @@ static void WIN_SetDPIAwareness( void )
MsgDev( D_NOTE, "SetDPIAwareness: Success\n" );
bSuccess = TRUE;
}
else if( hResult = E_INVALIDARG ) MsgDev( D_NOTE, "SetDPIAwareness: Invalid argument\n" );
else if( hResult == E_INVALIDARG ) MsgDev( D_NOTE, "SetDPIAwareness: Invalid argument\n" );
else if( hResult == E_ACCESSDENIED ) MsgDev( D_NOTE, "SetDPIAwareness: Access Denied\n" );
}
else MsgDev( D_NOTE, "SetDPIAwareness: Can't get SetProcessDpiAwareness\n" );
@ -540,6 +540,7 @@ void VID_RestoreScreenResolution( void ) @@ -540,6 +540,7 @@ void VID_RestoreScreenResolution( void )
}
#if defined(_WIN32) && !defined(XASH_64BIT) // ICO support only for Win32
#include "SDL_syswm.h"
static void WIN_SetWindowIcon( HICON ico )
{
SDL_SysWMinfo wminfo;

4
engine/platform/win32/win_con.c

@ -270,7 +270,7 @@ void Wcon_CreateConsole( void ) @@ -270,7 +270,7 @@ void Wcon_CreateConsole( void )
string FontName;
wc.style = 0;
wc.lpfnWndProc = (WNDPROC)Con_WndProc;
wc.lpfnWndProc = (WNDPROC)Wcon_WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = host.hInst;
@ -384,7 +384,7 @@ register console commands (dedicated only) @@ -384,7 +384,7 @@ register console commands (dedicated only)
void Wcon_InitConsoleCommands( void )
{
if( host.type != HOST_DEDICATED ) return;
Cmd_AddCommand( "clear", Con_Clear_f, "clear console history" );
Cmd_AddCommand( "clear", Wcon_Clear_f, "clear console history" );
}
/*

4
engine/platform/win32/win_lib.c

@ -915,7 +915,7 @@ void COM_FreeLibrary( void *hInstance ) @@ -915,7 +915,7 @@ void COM_FreeLibrary( void *hInstance )
Mem_Free( hInst ); // done
}
dword COM_FunctionFromName( void *hInstance, const char *pName )
void *COM_FunctionFromName( void *hInstance, const char *pName )
{
dll_user_t *hInst = (dll_user_t *)hInstance;
int i, index;
@ -938,7 +938,7 @@ dword COM_FunctionFromName( void *hInstance, const char *pName ) @@ -938,7 +938,7 @@ dword COM_FunctionFromName( void *hInstance, const char *pName )
return 0;
}
const char *COM_NameForFunction( void *hInstance, dword function )
const char *COM_NameForFunction( void *hInstance, void *function )
{
dll_user_t *hInst = (dll_user_t *)hInstance;
int i, index;

Loading…
Cancel
Save