From dc11b6315709fb9bdf124a05e2a90be261c9c9d9 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Thu, 24 Nov 2016 00:47:53 -0500 Subject: [PATCH] - Fixed building with vanilla MinGW, at least with whatever modified header files that my system has from my last experimentation. --- src/CMakeLists.txt | 8 ++++++-- src/win32/i_specialpaths.cpp | 9 +++++++++ src/win32/i_system.cpp | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7d532ca9c..a2bde0de5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -178,8 +178,12 @@ if( WIN32 ) comdlg32 ws2_32 setupapi - oleaut32 - DelayImp ) + oleaut32 ) + + if( NOT ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) + set( ZDOOM_LIBS ${ZDOOM_LIBS} DelayImp ) + endif() + if( DX_dxguid_LIBRARY ) list( APPEND ZDOOM_LIBS "${DX_dxguid_LIBRARY}" ) endif() diff --git a/src/win32/i_specialpaths.cpp b/src/win32/i_specialpaths.cpp index 745c12f12..cddeacde6 100644 --- a/src/win32/i_specialpaths.cpp +++ b/src/win32/i_specialpaths.cpp @@ -46,6 +46,15 @@ #include "optwin32.h" +// Vanilla MinGW does not have folder ids +#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) +static const GUID FOLDERID_LocalAppData = { 0xf1b32785, 0x6fba, 0x4fcf, 0x9d, 0x55, 0x7b, 0x8e, 0x7f, 0x15, 0x70, 0x91 }; +static const GUID FOLDERID_RoamingAppData = { 0x3eb685db, 0x65f9, 0x4cf6, 0xa0, 0x3a, 0xe3, 0xef, 0x65, 0x72, 0x9f, 0x3d }; +static const GUID FOLDERID_SavedGames = { 0x4c5c32ff, 0xbb9d, 0x43b0, 0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4 }; +static const GUID FOLDERID_Documents = { 0xfdd39ad0, 0x238f, 0x46af, 0xad, 0xb4, 0x6c, 0x85, 0x48, 0x03, 0x69, 0xc7 }; +static const GUID FOLDERID_Pictures = { 0x33e28130, 0x4e1e, 0x4676, 0x83, 0x5a, 0x98, 0x39, 0x5c, 0x3b, 0xc3, 0xbb }; +#endif + //=========================================================================== // // IsProgramDirectoryWritable diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index d55d1e093..29ea3c4b7 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -1314,7 +1314,7 @@ static HCURSOR CreateCompatibleCursor(FTexture *cursorpic) HDC dc = GetDC(NULL); if (dc == NULL) { - return false; + return nullptr; } HDC and_mask_dc = CreateCompatibleDC(dc); HDC xor_mask_dc = CreateCompatibleDC(dc); @@ -1721,7 +1721,7 @@ FString I_GetLongPathName(FString shortpath) using OptWin32::GetLongPathNameA; // Doesn't exist on NT4 - if (!GetLongPathName) + if (!GetLongPathNameA) return shortpath; DWORD buffsize = GetLongPathNameA(shortpath.GetChars(), NULL, 0);