(re3) Fix compiler errors related to MinGW #1262

Open
alextwothousand wants to merge 7 commits from alextwothousand/master into master

@ -113,6 +113,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang
-Wpedantic -Wpedantic
) )
endif() endif()
if (NOT WIN32 AND NOT APPLE)
target_link_libraries(${EXECUTABLE}
PRIVATE
X11
)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(${EXECUTABLE} target_compile_options(${EXECUTABLE}
PUBLIC PUBLIC
@ -120,6 +126,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
) )
endif() endif()
if (WIN32)
target_link_libraries(${EXECUTABLE} PRIVATE
winnm)
endif()
set_target_properties(${EXECUTABLE} set_target_properties(${EXECUTABLE}
PROPERTIES PROPERTIES
C_STANDARD 11 C_STANDARD 11

@ -233,7 +233,9 @@ psGrabScreen(RwCamera *pCamera)
***************************************************************************** *****************************************************************************
*/ */
#ifdef _WIN32 #ifdef _WIN32
#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
#pragma comment( lib, "Winmm.lib" ) // Needed for time #pragma comment( lib, "Winmm.lib" ) // Needed for time
#endif
RwUInt32 RwUInt32
psTimer(void) psTimer(void)
{ {
@ -1129,11 +1131,11 @@ void InitialiseLanguage()
#else #else
WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID()); WORD primUserLCID = PRIMARYLANGID(GetSystemDefaultLCID());
WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID()); WORD primSystemLCID = PRIMARYLANGID(GetUserDefaultLCID());
WORD primLayout = PRIMARYLANGID((DWORD)GetKeyboardLayout(0)); WORD primLayout = PRIMARYLANGID((DWORD_PTR)GetKeyboardLayout(0));
WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID()); WORD subUserLCID = SUBLANGID(GetSystemDefaultLCID());
WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID()); WORD subSystemLCID = SUBLANGID(GetUserDefaultLCID());
WORD subLayout = SUBLANGID((DWORD)GetKeyboardLayout(0)); WORD subLayout = SUBLANGID((DWORD_PTR)GetKeyboardLayout(0));
#endif #endif
if ( primUserLCID == LANG_GERMAN if ( primUserLCID == LANG_GERMAN
|| primSystemLCID == LANG_GERMAN || primSystemLCID == LANG_GERMAN