- Fixed build with MinGW-w64 (TDM-GCC 5.1). Note that the resulting binary will crash under -O3 until the alignment violation is taken care of in FRemapTable::Alloc.

- It appears that CMake added native support for building rc files with MinGW at some point so removed manual rc compiling code.
This commit is contained in:
Braden Obrzut 2016-11-22 21:22:39 -05:00
parent c28bcca3f3
commit 789315bb4a
9 changed files with 26 additions and 72 deletions

View file

@ -728,15 +728,7 @@ if( WIN32 )
set( SYSTEM_SOURCES ${PLAT_WIN32_SOURCES} )
set( OTHER_SYSTEM_SOURCES ${PLAT_POSIX_SOURCES} ${PLAT_SDL_SOURCES} ${PLAT_OSX_SOURCES} ${PLAT_COCOA_SOURCES} ${PLAT_UNIX_SOURCES} )
if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
# CMake is not set up to compile and link rc files with GCC. :(
add_custom_command( OUTPUT zdoom-rc.o
COMMAND windres -o zdoom-rc.o -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zdoom.rc
DEPENDS win32/zdoom.rc )
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} zdoom-rc.o )
else()
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} win32/zdoom.rc )
endif()
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} win32/zdoom.rc )
elseif( APPLE )
if( OSX_COCOA_BACKEND )
set( SYSTEM_SOURCES_DIR posix posix/cocoa )

View file

@ -97,5 +97,5 @@ bool FModule::Open(const char* lib)
void *FModule::GetSym(const char* name)
{
return GetProcAddress((HMODULE)handle, name);
return (void *)GetProcAddress((HMODULE)handle, name);
}

View file

@ -72,7 +72,7 @@ FRenderer *Renderer;
IMPLEMENT_ABSTRACT_CLASS (DCanvas)
IMPLEMENT_ABSTRACT_CLASS (DFrameBuffer)
#if defined(_DEBUG) && defined(_M_IX86)
#if defined(_DEBUG) && defined(_M_IX86) && !defined(__MINGW32__)
#define DBGBREAK { __asm int 3 }
#else
#define DBGBREAK

View file

@ -75,54 +75,6 @@
#include <time.h>
#include <zlib.h>
#if defined(_WIN64) && defined(__GNUC__)
struct KNONVOLATILE_CONTEXT_POINTERS {
union {
PDWORD64 IntegerContext[16];
struct {
PDWORD64 Rax;
PDWORD64 Rcx;
PDWORD64 Rdx;
PDWORD64 Rbx;
PDWORD64 Rsp;
PDWORD64 Rbp;
PDWORD64 Rsi;
PDWORD64 Rdi;
PDWORD64 R8;
PDWORD64 R9;
PDWORD64 R10;
PDWORD64 R11;
PDWORD64 R12;
PDWORD64 R13;
PDWORD64 R14;
PDWORD64 R15;
};
};
};
typedef
EXCEPTION_DISPOSITION
NTAPI
EXCEPTION_ROUTINE (
struct _EXCEPTION_RECORD *ExceptionRecord,
PVOID EstablisherFrame,
struct _CONTEXT *ContextRecord,
PVOID DispatcherContext
);
NTSYSAPI
EXCEPTION_ROUTINE *
NTAPI
RtlVirtualUnwind (
DWORD HandlerType,
DWORD64 ImageBase,
DWORD64 ControlPc,
PRUNTIME_FUNCTION FunctionEntry,
PCONTEXT ContextRecord,
PVOID *HandlerData,
PDWORD64 EstablisherFrame,
KNONVOLATILE_CONTEXT_POINTERS *ContextPointers
);
#endif
// MACROS ------------------------------------------------------------------
#define REMOTE_HOST "localhost"

View file

@ -21,6 +21,11 @@
#define DINPUT_BUFFERSIZE 32
// MinGW-w64 (TDM5.1 - 2016/11/21)
#ifndef DIK_PREVTRACK
#define DIK_PREVTRACK DIK_CIRCUMFLEX
#endif
// TYPES -------------------------------------------------------------------
class FDInputKeyboard : public FKeyboard

View file

@ -389,7 +389,7 @@ bool FRawPS2Controller::ProcessInput(RAWHID *raw, int code)
{
// w32api has an incompatible definition of bRawData.
// (But the version that comes with MinGW64 is fine.)
#if defined(__GNUC__) && !defined(_WIN64)
#if defined(__GNUC__) && !defined(__MINGW64_VERSION_MAJOR)
BYTE *rawdata = &raw->bRawData;
#else
BYTE *rawdata = raw->bRawData;

View file

@ -33,6 +33,7 @@
**
*/
#define _WIN32_WINNT 0x0601
#include <windows.h>
#include <lmcons.h>
#include <shlobj.h>

View file

@ -33,6 +33,17 @@
#define XUSER_MAX_COUNT 4
#endif
// MinGW
#ifndef XINPUT_DLL
#define XINPUT_DLL_A "xinput1_3.dll"
#define XINPUT_DLL_W L"xinput1_3.dll"
#ifdef UNICODE
#define XINPUT_DLL XINPUT_DLL_W
#else
#define XINPUT_DLL XINPUT_DLL_A
#endif
#endif
// TYPES -------------------------------------------------------------------
typedef DWORD (WINAPI *XInputGetStateType)(DWORD index, XINPUT_STATE *state);

View file

@ -1,19 +1,12 @@
cmake_minimum_required( VERSION 2.8.7 )
if( WIN32 )
if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE OR ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/trustinfo.o
COMMAND windres -o ${CMAKE_CURRENT_BINARY_DIR}/trustinfo.o -i ${CMAKE_CURRENT_SOURCE_DIR}/trustinfo.rc
DEPENDS trustinfo.rc )
set( TRUSTINFO trustinfo.o )
if( MSVC_VERSION GREATER 1399 )
# VC 8+ adds a manifest automatically to the executable. We need to
# merge ours with it.
set( MT_MERGE ON )
else()
if( MSVC_VERSION GREATER 1399 )
# VC 8+ adds a manifest automatically to the executable. We need to
# merge ours with it.
set( MT_MERGE ON )
else( MSVC_VERSION GREATER 1399 )
set( TRUSTINFO trustinfo.rc )
endif( MSVC_VERSION GREATER 1399 )
set( TRUSTINFO trustinfo.rc )
endif()
else( WIN32 )
set( TRUSTINFO "" )