diff --git a/src/cmdline/RootCommands.cpp b/src/cmdline/RootCommands.cpp index 6f54a4b6ec..df280935ce 100644 --- a/src/cmdline/RootCommands.cpp +++ b/src/cmdline/RootCommands.cpp @@ -58,7 +58,7 @@ static exitcode_t HandleCommandHost(CommandLineArgEnumerator * enumerator); static exitcode_t HandleCommandJoin(CommandLineArgEnumerator * enumerator); static exitcode_t HandleCommandSetRCT2(CommandLineArgEnumerator * enumerator); -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) && !defined(__MINGW32__) static bool _removeShell = false; @@ -87,7 +87,7 @@ const CommandLineCommand CommandLine::RootCommands[] #endif DefineCommand("set-rct2", "", StandardOptions, HandleCommandSetRCT2), -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) && !defined(__MINGW32__) DefineCommand("register-shell", "", RegisterShellOptions, HandleCommandRegisterShell), #endif @@ -338,7 +338,7 @@ static exitcode_t HandleCommandSetRCT2(CommandLineArgEnumerator * enumerator) } } -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) && !defined(__MINGW32__) static exitcode_t HandleCommandRegisterShell(CommandLineArgEnumerator * enumerator) { exitcode_t result = CommandLine::HandleCommandDefault(); @@ -357,7 +357,7 @@ static exitcode_t HandleCommandRegisterShell(CommandLineArgEnumerator * enumerat } return EXITCODE_OK; } -#endif // __WINDOWS__ +#endif // defined(__WINDOWS__) && !defined(__MINGW32__) static void PrintAbout() { diff --git a/src/platform/windows.c b/src/platform/windows.c index 34ea0d3356..ab7cfc2c30 100644 --- a/src/platform/windows.c +++ b/src/platform/windows.c @@ -1035,9 +1035,14 @@ utf8* platform_get_username() { return username; } +#ifndef __MINGW32__ +/////////////////////////////////////////////////////////////////////////////// +// File association setup +/////////////////////////////////////////////////////////////////////////////// + #define SOFTWARE_CLASSES L"Software\\Classes" -void get_progIdName(wchar_t *dst, const utf8 *extension) +static void get_progIdName(wchar_t *dst, const utf8 *extension) { utf8 progIdName[128]; safe_strcpy(progIdName, OPENRCT2_NAME, sizeof(progIdName)); @@ -1048,12 +1053,13 @@ void get_progIdName(wchar_t *dst, const utf8 *extension) free(progIdNameW); } -bool windows_setup_file_association(const utf8 * extension, - const utf8 * fileTypeText, - const utf8 * commandText, - const utf8 * commandArgs, - const uint32 iconIndex) -{ +static bool windows_setup_file_association( + const utf8 * extension, + const utf8 * fileTypeText, + const utf8 * commandText, + const utf8 * commandArgs, + const uint32 iconIndex +) { wchar_t exePathW[MAX_PATH]; wchar_t dllPathW[MAX_PATH]; @@ -1125,7 +1131,7 @@ fail: return result; } -void windows_remove_file_association(const utf8 * extension) +static void windows_remove_file_association(const utf8 * extension) { // [HKEY_CURRENT_USER\Software\Classes] HKEY hRootKey; @@ -1170,4 +1176,6 @@ void platform_remove_file_associations() SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); } +/////////////////////////////////////////////////////////////////////////////// +#endif #endif