Hi, OpenRCT2 dev here.
Since I'm maintaining Linux side of our project, ability to compile with Mingw-w64 is important to me when I need to check various things.
Due to that fact, I can also produce builds for platforms that Windows cannot really target anymore, like winnt 5.1. We have made upstream target winnt>=6.0, but there is very little platform code, so reverting it was trivial.
Long story short, here's the obligatory screenshot: [ external image ]https://imgur.com/gallery/H0TdZ
Here's my branch: https://github.com/janisozaur/OpenRCT2/tree/reactos, it was verified working on ArchLinux with Mingw-w64 5.0.2
Since the patch is very small, I'll also quote it down below to help preserve it.
You can fetch a mostly-static test build I made from this link: https://transfer.sh/duCn9/openrct2-reactos.zip – it will autoexpire in two weeks' time. Feel free to mirror it elsewhere if you want to.
OpenRCT2 uses following libs:
- sdl2
- sdl2-ttf (can be disabled)
- fontconfig (can be disabled)
- libzip (>= 1.0)
- libpng (>= 1.2)
- speexdsp
- curl (only if building with http support)
- jansson (>= 2.5)
- openssl (>= 1.0; only if building with multiplayer support)
- iconv (part of glibc on Linux)
- zlib
- gl (commonly provided by Mesa or GPU vendors; can be disabled)
- cmake
Code: Select all
diff --git a/src/openrct2/platform/windows.c b/src/openrct2/platform/windows.c
index cc528147a..68f6970b8 100644
--- a/src/openrct2/platform/windows.c
+++ b/src/openrct2/platform/windows.c
@@ -14,12 +14,6 @@
*****************************************************************************/
#pragma endregion
-#ifdef __MINGW32__
-// 0x0600 == vista
-#define WINVER 0x0600
-#define _WIN32_WINNT 0x0600
-#endif // __MINGW32__
-
#include "../common.h"
#ifdef __WINDOWS__
@@ -954,10 +948,10 @@ uint8 platform_get_locale_date_format()
{
// Retrieve short date format, eg "MM/dd/yyyy"
wchar_t dateFormat[20];
- if (GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SSHORTDATE, dateFormat, sizeof(dateFormat)) == 0)
- {
+ //if (GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SSHORTDATE, dateFormat, sizeof(dateFormat)) == 0)
+ //{
return DATE_FORMAT_DAY_MONTH_YEAR;
- }
+ //}
// The only valid characters for format types are: dgyM
// We try to find 3 strings of format types, ignore any characters in between.
@@ -1023,7 +1017,7 @@ void platform_get_exe_path(utf8 *outPath, size_t outSize)
GetModuleFileNameW(NULL, exePath, MAX_PATH);
exeDelimiter = wcsrchr(exePath, *PATH_SEPARATOR);
*exeDelimiter = L'\0';
- wcscpy_s(tempPath, MAX_PATH, exePath);
+ wcscpy(tempPath, exePath);
_wfullpath(exePath, tempPath, MAX_PATH);
WideCharToMultiByte(CP_UTF8, 0, exePath, MAX_PATH, outPath, (sint32) outSize, NULL, NULL);
}
@@ -1081,6 +1075,7 @@ utf8* platform_get_username() {
return username;
}
+#ifndef __MINGW32__
///////////////////////////////////////////////////////////////////////////////
// File association setup
///////////////////////////////////////////////////////////////////////////////
@@ -1276,6 +1271,7 @@ bool platform_setup_uri_protocol()
return false;
}
+#endif
///////////////////////////////////////////////////////////////////////////////
sint32 platform_get_non_window_flags()