From 4d5364e9e49365b3ce2fec53c77320c46a1b2268 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 30 Apr 2022 21:19:15 +0200 Subject: [PATCH] (Windows) Fixed a MinGW compile error. --- es-core/src/utils/PlatformUtil.cpp | 5 +++-- es-core/src/utils/PlatformUtil.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/es-core/src/utils/PlatformUtil.cpp b/es-core/src/utils/PlatformUtil.cpp index 4f904da8f..a702c464c 100644 --- a/es-core/src/utils/PlatformUtil.cpp +++ b/es-core/src/utils/PlatformUtil.cpp @@ -147,7 +147,7 @@ namespace Utils } int launchGameWindows(const std::wstring& cmd_utf16, - std::wstring& startDirectory, + const std::wstring& startDirectory, bool runInBackground, bool hideWindow) { @@ -165,7 +165,8 @@ namespace Utils bool processReturnValue = true; DWORD errorCode = 0; - wchar_t* startDir {startDirectory == L"" ? nullptr : &startDirectory[0]}; + std::wstring startDirectoryTemp {startDirectory}; + wchar_t* startDir {startDirectory == L"" ? nullptr : &startDirectoryTemp[0]}; // clang-format off processReturnValue = CreateProcessW( diff --git a/es-core/src/utils/PlatformUtil.h b/es-core/src/utils/PlatformUtil.h index 6b5a12023..1dd319f5c 100644 --- a/es-core/src/utils/PlatformUtil.h +++ b/es-core/src/utils/PlatformUtil.h @@ -37,7 +37,7 @@ namespace Utils const std::string& startDirectory, bool runInBackground); int launchGameWindows(const std::wstring& cmd_utf16, - std::wstring& startDirectory, + const std::wstring& startDirectory, bool runInBackground, bool hideWindow);