diff --git a/CMakeLists.txt b/CMakeLists.txt index cb3beeea9d..1328491d3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,7 +244,7 @@ else() # If we're compiling with a custom GCC on the Mac (which we know since g++-4.2 doesn't support C++11) statically link libgcc. set( ALL_C_FLAGS "-static-libgcc" ) endif() - else() + elseif( NOT MINGW ) # Generic GCC/Clang requires position independent executable to be enabled explicitly set( ALL_C_FLAGS "${ALL_C_FLAGS} -fPIE" ) set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie" ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5fe9b18fe5..59b1e706cc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -81,6 +81,11 @@ if( WIN32 ) find_library( DX_dinput8_LIBRARY dinput8 PATHS ENV DXSDK_DIR PATH_SUFFIXES Lib Lib/${XBITS} ) + if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) + find_library( DX_dxguid_LIBRARY dxguid + PATHS ENV DXSDK_DIR + PATH_SUFFIXES Lib Lib/${XBITS} ) + endif() # Modern versions of the Windows SDK include dinput8.lib. Unfortunately, # CMake cannot find these libraries via find_library. @@ -89,6 +94,13 @@ if( WIN32 ) set( DX_dinput8_LIBRARY dinput8 ) endif() + if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) + # Modern versions of the Windows SDK do NOT include dxguid.lib. Its contents + # were moved to dinput8.lib. + if( NOT DX_dxguid_LIBRARY ) + message( STATUS "Could not find dxguid.lib. Build may fail on old Windows SDKs.") + endif() + endif() endif() set( ZDOOM_LIBS @@ -109,6 +121,11 @@ if( WIN32 ) set( ZDOOM_LIBS ${ZDOOM_LIBS} DelayImp ) endif() + if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) + if( DX_dxguid_LIBRARY ) + list( APPEND ZDOOM_LIBS "${DX_dxguid_LIBRARY}" ) + endif() + endif() else() if( APPLE ) set( NO_GTK ON ) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index af8047a3d0..bb2c091a3c 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -534,7 +534,7 @@ int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, FixPathSeperator(custwad); DefaultExtension(custwad, ext); bool isAbsolute = (custwad[0] == '/'); -#ifdef WINDOWS +#ifdef _WIN32 isAbsolute |= (custwad.Len() >= 2 && custwad[1] == ':'); #endif if (isAbsolute) diff --git a/src/d_main.cpp b/src/d_main.cpp index 615b41f922..63c0b599fd 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -28,6 +28,10 @@ // HEADER FILES ------------------------------------------------------------ +#ifdef _WIN32 +#include +#endif + #ifdef HAVE_FPU_CONTROL #include #endif diff --git a/src/d_net.cpp b/src/d_net.cpp index 453a1ff322..2e8e9aca22 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -26,6 +26,7 @@ //----------------------------------------------------------------------------- #include +#define __STDC_FORMAT_MACROS #include #include "version.h" diff --git a/src/g_mapinfo.cpp b/src/g_mapinfo.cpp index 72fab5071c..9eb80ae09a 100644 --- a/src/g_mapinfo.cpp +++ b/src/g_mapinfo.cpp @@ -557,7 +557,7 @@ void FMapInfoParser::SkipToNext() void FMapInfoParser::CheckEndOfFile(const char *block) { - if (format_type == FMT_New && !sc.Compare("}")) + if (format_type == FMT_New && sc.End) { sc.ScriptError("Unexpected end of file in %s definition", block); } diff --git a/src/textures/hires/hirestex.cpp b/src/textures/hires/hirestex.cpp index c5aed16243..dae7654a08 100644 --- a/src/textures/hires/hirestex.cpp +++ b/src/textures/hires/hirestex.cpp @@ -24,6 +24,12 @@ ** */ +#ifdef _MSC_VER +#include +#else +#include +#endif + #include "w_wad.h" #include "m_png.h" #include "sbar.h" @@ -32,7 +38,6 @@ #include "bitmap.h" #ifndef _WIN32 -#include #define _access(a,b) access(a,b) #endif diff --git a/src/textures/hires/hqresize.cpp b/src/textures/hires/hqresize.cpp index 9c176974d7..eb121ced86 100644 --- a/src/textures/hires/hqresize.cpp +++ b/src/textures/hires/hqresize.cpp @@ -235,7 +235,7 @@ static unsigned char *hqNxAsmHelper( void (*hqNxFunction) ( int*, unsigned char* } #endif -static unsigned char *hqNxHelper( void (*hqNxFunction) ( unsigned*, unsigned*, int, int ), +static unsigned char *hqNxHelper( void (HQX_CALLCONV *hqNxFunction) ( unsigned*, unsigned*, int, int ), const int N, unsigned char *inputBuffer, const int inWidth, diff --git a/src/win32/zdoom.rc b/src/win32/zdoom.rc index b8a8e446ce..325c1d064e 100644 --- a/src/win32/zdoom.rc +++ b/src/win32/zdoom.rc @@ -75,7 +75,7 @@ BEGIN " VALUE ""FileDescription"", ""GZDoom""\r\n" " VALUE ""FileVersion"", RC_FILEVERSION2\r\n" " VALUE ""InternalName"", ""GZDoom""\r\n" - " VALUE ""LegalCopyright"", ""Copyright \\u00A9 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al.""\r\n" + " VALUE ""LegalCopyright"", ""Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al.""\r\n" " VALUE ""LegalTrademarks"", ""DoomR is a Registered Trademark of id Software, Inc.""\r\n" " VALUE ""OriginalFilename"", ""gzdoom.exe""\r\n" " VALUE ""ProductName"", ""GZDoom""\r\n" @@ -224,6 +224,7 @@ IDD_IWADDIALOG DIALOGEX 0, 0, 224, 249 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "Welcome" +#ifndef __MINGW32__ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US FONT 8, "MS Shell Dlg" { @@ -243,6 +244,26 @@ FONT 8, "MS Shell Dlg" CONTROL "Play GZDoom", IDOK, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 8, 228, 90, 14 CONTROL "Exit", IDCANCEL, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 166, 228, 50, 14 } +#else +// [SP] Upstreamed from Zandronum +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + ICON IDI_ICON1,IDC_STATIC,7,7,21,20 + LTEXT "Welcome to GZDoom!",IDC_STATIC,42,8,180,8 + LTEXT "",IDC_WELCOME_VERSION,42,18,180,8 + GROUPBOX "IWAD selection",IDC_STATIC,8,32,208,102 + LTEXT "Select which game file (IWAD) to run.",IDC_STATIC,12,44,190,8 + LISTBOX IDC_IWADLIST,12,56,200,72,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Video settings",IDC_STATIC,8,138,208,28 + CONTROL "Fullscreen",IDC_WELCOME_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,124,150,48,10 + CONTROL "Disable autoload",IDC_WELCOME_NOAUTOLOAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,148,39,65,10 + CONTROL "Lights.pk3",IDC_WELCOME_LIGHTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,46,182,51,10 + CONTROL "Brightmaps.pk3",IDC_WELCOME_BRIGHTMAPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,111,182,65,10 + CONTROL "Don't ask me this again",IDC_DONTASKIWAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,73,201,87,10 + DEFPUSHBUTTON "Play GZDoom",IDOK,8,228,90,14 + PUSHBUTTON "Exit",IDCANCEL,166,228,50,14 +END +#endif IDD_EAXPROPERTYLIST DIALOGEX 0, 0, 265, 404 STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VSCROLL @@ -474,7 +495,7 @@ IDB_DEADGUY BITMAP "deadguy.bmp" // Generated from the TEXTINCLUDE 3 resource. // #ifndef NO_MANIFEST -// CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "zdoom.exe.manifest" + CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "zdoom.exe.manifest" #endif ///////////////////////////////////////////////////////////////////////////// @@ -505,7 +526,7 @@ BEGIN VALUE "FileDescription", "GZDoom" VALUE "FileVersion", RC_FILEVERSION2 VALUE "InternalName", "GZDoom" - VALUE "LegalCopyright", "Copyright \u00A9 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al." + VALUE "LegalCopyright", "Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al." VALUE "LegalTrademarks", "DoomR is a Registered Trademark of id Software, Inc." VALUE "OriginalFilename", "gzdoom.exe" VALUE "ProductName", "GZDoom"