From 911e9a37f17161d4109163496009a4d66682b5f8 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Mon, 28 Jun 2021 20:16:48 +1000 Subject: [PATCH] WIN32 macro -> _WIN32 --- src/common-tests/file_system_tests.cpp | 2 +- src/common/assert.cpp | 10 +++--- src/common/byte_stream.cpp | 16 ++++----- src/common/event.cpp | 6 ++-- src/common/event.h | 6 ++-- src/common/file_system.cpp | 8 ++--- src/common/file_system.h | 2 +- src/common/gl/context.cpp | 4 +-- src/common/gl/context.h | 2 +- src/common/jit_code_buffer.cpp | 12 +++---- src/common/log.cpp | 4 +-- src/common/memory_arena.cpp | 20 +++++------ src/common/memory_arena.h | 2 +- src/common/page_fault_handler.cpp | 8 ++--- src/common/string_util.cpp | 6 ++-- src/common/string_util.h | 2 +- src/common/timer.cpp | 6 ++-- src/common/timestamp.cpp | 36 +++++++++---------- src/common/timestamp.h | 6 ++-- src/core/cpu_recompiler_types.h | 4 +-- src/core/settings.cpp | 4 +-- src/core/system.cpp | 2 +- src/core/texture_replacements.cpp | 2 +- src/core/types.h | 2 +- .../nogui_host_interface.cpp | 8 ++--- src/duckstation-qt/autoupdaterdialog.cpp | 4 +-- src/duckstation-qt/autoupdaterdialog.h | 2 +- src/duckstation-qt/debuggerwindow.cpp | 2 +- src/duckstation-qt/displaysettingswidget.cpp | 4 +-- src/duckstation-qt/mainwindow.cpp | 2 +- src/duckstation-qt/qtdisplaywidget.cpp | 4 +-- src/duckstation-qt/qthostinterface.cpp | 10 +++--- src/frontend-common/common_host_interface.cpp | 6 ++-- src/frontend-common/controller_interface.cpp | 8 ++--- src/frontend-common/controller_interface.h | 2 +- src/frontend-common/cubeb_audio_stream.cpp | 6 ++-- src/frontend-common/cubeb_audio_stream.h | 2 +- src/frontend-common/fullscreen_ui.cpp | 4 +-- src/frontend-common/game_settings.cpp | 2 +- src/frontend-common/ini_settings_interface.h | 2 +- src/updater/updater.cpp | 6 ++-- 41 files changed, 123 insertions(+), 123 deletions(-) diff --git a/src/common-tests/file_system_tests.cpp b/src/common-tests/file_system_tests.cpp index 2456fefb8..bfa8176eb 100644 --- a/src/common-tests/file_system_tests.cpp +++ b/src/common-tests/file_system_tests.cpp @@ -3,7 +3,7 @@ TEST(FileSystem, IsAbsolutePath) { -#ifdef WIN32 +#ifdef _WIN32 ASSERT_TRUE(FileSystem::IsAbsolutePath("C:\\")); ASSERT_TRUE(FileSystem::IsAbsolutePath("C:\\Path")); ASSERT_TRUE(FileSystem::IsAbsolutePath("C:\\Path\\Subdirectory")); diff --git a/src/common/assert.cpp b/src/common/assert.cpp index fe97974bf..03ce57d41 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp @@ -3,7 +3,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include "windows_headers.h" #include #include @@ -13,7 +13,7 @@ static std::mutex s_AssertFailedMutex; static inline void FreezeThreads(void** ppHandle) { -#ifdef WIN32 +#ifdef _WIN32 HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); if (hSnapshot != INVALID_HANDLE_VALUE) { @@ -43,7 +43,7 @@ static inline void FreezeThreads(void** ppHandle) static inline void ResumeThreads(void* pHandle) { -#ifdef WIN32 +#ifdef _WIN32 HANDLE hSnapshot = (HANDLE)pHandle; if (pHandle != INVALID_HANDLE_VALUE) { @@ -79,7 +79,7 @@ void Y_OnAssertFailed(const char* szMessage, const char* szFunction, const char* char szMsg[512]; std::snprintf(szMsg, sizeof(szMsg), "%s in function %s (%s:%u)", szMessage, szFunction, szFile, uLine); -#ifdef WIN32 +#ifdef _WIN32 SetConsoleTextAttribute(GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY); WriteConsoleA(GetStdHandle(STD_ERROR_HANDLE), szMsg, static_cast(std::strlen(szMsg)), NULL, NULL); OutputDebugStringA(szMsg); @@ -114,7 +114,7 @@ void Y_OnPanicReached(const char* szMessage, const char* szFunction, const char* char szMsg[512]; std::snprintf(szMsg, sizeof(szMsg), "%s in function %s (%s:%u)", szMessage, szFunction, szFile, uLine); -#ifdef WIN32 +#ifdef _WIN32 SetConsoleTextAttribute(GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY); WriteConsoleA(GetStdHandle(STD_ERROR_HANDLE), szMsg, static_cast(std::strlen(szMsg)), NULL, NULL); OutputDebugStringA(szMsg); diff --git a/src/common/byte_stream.cpp b/src/common/byte_stream.cpp index 20d00ba02..5e0b5cdb7 100644 --- a/src/common/byte_stream.cpp +++ b/src/common/byte_stream.cpp @@ -9,7 +9,7 @@ #include #include #include -#if defined(WIN32) +#if defined(_WIN32) #include "windows_headers.h" #include #include @@ -118,7 +118,7 @@ public: return true; } -#if defined(WIN32) +#if defined(_WIN32) virtual bool SeekAbsolute(u64 Offset) override { @@ -265,7 +265,7 @@ public: { if (m_discarded) { -#if WIN32 +#if _WIN32 // delete the temporary file if (!DeleteFileW(StringUtil::UTF8StringToWideString(m_temporaryFileName).c_str())) { @@ -308,7 +308,7 @@ public: fflush(m_pFile); -#ifdef WIN32 +#ifdef _WIN32 // move the atomic file name to the original file name if (!MoveFileExW(StringUtil::UTF8StringToWideString(m_temporaryFileName).c_str(), StringUtil::UTF8StringToWideString(m_originalFileName).c_str(), MOVEFILE_REPLACE_EXISTING)) @@ -975,7 +975,7 @@ std::unique_ptr ByteStream_OpenFileStream(const char* fileName, u32 } // append platform path seperator -#if defined(WIN32) +#if defined(_WIN32) tempStr[i] = '\\'; #else tempStr[i] = '/'; @@ -1119,7 +1119,7 @@ std::unique_ptr ByteStream_OpenFileStream(const char* fileName, u32 const u32 fileNameLength = static_cast(std::strlen(fileName)); char* tempStr = (char*)alloca(fileNameLength + 1); -#if defined(WIN32) +#if defined(_WIN32) // check if it starts with a drive letter. if so, skip ahead if (fileNameLength >= 2 && fileName[1] == ':') { @@ -1156,7 +1156,7 @@ std::unique_ptr ByteStream_OpenFileStream(const char* fileName, u32 if (errno == ENOENT) { // try creating it -#if defined(WIN32) +#if defined(_WIN32) if (mkdir(tempStr) < 0) #else if (mkdir(tempStr, 0777) < 0) @@ -1175,7 +1175,7 @@ std::unique_ptr ByteStream_OpenFileStream(const char* fileName, u32 } // append platform path seperator -#if defined(WIN32) +#if defined(_WIN32) tempStr[i] = '\\'; #else tempStr[i] = '/'; diff --git a/src/common/event.cpp b/src/common/event.cpp index 07a5db36b..126d9372d 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1,7 +1,7 @@ #include "event.h" #include "assert.h" -#if defined(WIN32) +#if defined(_WIN32) #include "windows_headers.h" #include #elif defined(__linux__) || defined(__APPLE__) || defined(__HAIKU__) @@ -11,7 +11,7 @@ namespace Common { -#if defined(WIN32) && defined(USE_WIN32_EVENT_OBJECTS) +#if defined(_WIN32) && defined(USE_WIN32_EVENT_OBJECTS) Event::Event(bool auto_reset /* = false */) { @@ -55,7 +55,7 @@ void Event::WaitForMultiple(Event** events, u32 num_events) WaitForMultipleObjects(num_events, event_handles, TRUE, INFINITE); } -#elif defined(WIN32) +#elif defined(_WIN32) Event::Event(bool auto_reset /* = false */) : m_auto_reset(auto_reset) { diff --git a/src/common/event.h b/src/common/event.h index ad3106195..9f525ad40 100644 --- a/src/common/event.h +++ b/src/common/event.h @@ -3,7 +3,7 @@ // #define USE_WIN32_EVENT_OBJECTS 1 -#if defined(WIN32) && !defined(USE_WIN32_EVENT_OBJECTS) +#if defined(_WIN32) && !defined(USE_WIN32_EVENT_OBJECTS) #include "windows_headers.h" #include #elif defined(__linux__) || defined(__APPLE__) || defined(__HAIKU__) @@ -31,9 +31,9 @@ public: static void WaitForMultiple(Event** events, u32 num_events); private: -#if defined(WIN32) && defined(USE_WIN32_EVENT_OBJECTS) +#if defined(_WIN32) && defined(USE_WIN32_EVENT_OBJECTS) void* m_event_handle; -#elif defined(WIN32) +#elif defined(_WIN32) CRITICAL_SECTION m_cs; CONDITION_VARIABLE m_cv; std::atomic_uint32_t m_waiters{0}; diff --git a/src/common/file_system.cpp b/src/common/file_system.cpp index 76761993d..8efe8e93a 100644 --- a/src/common/file_system.cpp +++ b/src/common/file_system.cpp @@ -19,7 +19,7 @@ #include #endif -#if defined(WIN32) +#if defined(_WIN32) #include #else #include @@ -573,7 +573,7 @@ void SanitizeFileName(std::string& Destination, bool StripSlashes /* = true*/) bool IsAbsolutePath(const std::string_view& path) { -#ifdef WIN32 +#ifdef _WIN32 return (path.length() >= 3 && ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) && path[1] == ':' && (path[2] == '/' || path[2] == '\\')); #else @@ -713,7 +713,7 @@ std::vector GetRootDirectoryList() { std::vector results; -#ifdef WIN32 +#ifdef _WIN32 char buf[256]; if (GetLogicalDriveStringsA(sizeof(buf), buf) != 0) { @@ -774,7 +774,7 @@ FileSystem::ManagedCFilePtr OpenManagedCFile(const char* filename, const char* m std::FILE* OpenCFile(const char* filename, const char* mode) { -#ifdef WIN32 +#ifdef _WIN32 int filename_len = static_cast(std::strlen(filename)); int mode_len = static_cast(std::strlen(mode)); int wlen = MultiByteToWideChar(CP_UTF8, 0, filename, filename_len, nullptr, 0); diff --git a/src/common/file_system.h b/src/common/file_system.h index 5117e79fd..9547a74f5 100644 --- a/src/common/file_system.h +++ b/src/common/file_system.h @@ -9,7 +9,7 @@ class ByteStream; -#ifdef WIN32 +#ifdef _WIN32 #define FS_OSPATH_SEPARATOR_CHARACTER '\\' #define FS_OSPATH_SEPARATOR_STR "\\" #else diff --git a/src/common/gl/context.cpp b/src/common/gl/context.cpp index 7c4e94734..8f7816c75 100644 --- a/src/common/gl/context.cpp +++ b/src/common/gl/context.cpp @@ -9,7 +9,7 @@ #endif Log_SetChannel(GL::Context); -#if defined(WIN32) && !defined(_M_ARM64) +#if defined(_WIN32) && !defined(_M_ARM64) #include "context_wgl.h" #elif defined(__APPLE__) && !defined(LIBERTRO) #include "context_agl.h" @@ -97,7 +97,7 @@ std::unique_ptr Context::Create(const WindowInfo& wi, const Version } std::unique_ptr context; -#if defined(WIN32) && !defined(_M_ARM64) +#if defined(_WIN32) && !defined(_M_ARM64) context = ContextWGL::Create(wi, versions_to_try, num_versions_to_try); #elif defined(__APPLE__) context = ContextAGL::Create(wi, versions_to_try, num_versions_to_try); diff --git a/src/common/gl/context.h b/src/common/gl/context.h index 70cf8cf0f..905cd5d41 100644 --- a/src/common/gl/context.h +++ b/src/common/gl/context.h @@ -67,7 +67,7 @@ public: static const std::array& GetAllVersionsList(); protected: -#ifdef WIN32 +#ifdef _WIN32 #endif WindowInfo m_wi; diff --git a/src/common/jit_code_buffer.cpp b/src/common/jit_code_buffer.cpp index 121c01886..ee595833c 100644 --- a/src/common/jit_code_buffer.cpp +++ b/src/common/jit_code_buffer.cpp @@ -6,7 +6,7 @@ #include Log_SetChannel(JitCodeBuffer); -#if defined(WIN32) +#if defined(_WIN32) #include "windows_headers.h" #else #include @@ -43,7 +43,7 @@ bool JitCodeBuffer::Allocate(u32 size /* = 64 * 1024 * 1024 */, u32 far_code_siz m_total_size = size + far_code_size; -#if defined(WIN32) +#if defined(_WIN32) m_code_ptr = static_cast(VirtualAlloc(nullptr, m_total_size, MEM_COMMIT, PAGE_EXECUTE_READWRITE)); if (!m_code_ptr) { @@ -88,7 +88,7 @@ bool JitCodeBuffer::Initialize(void* buffer, u32 size, u32 far_code_size /* = 0 if ((far_code_size > 0 && guard_size >= far_code_size) || (far_code_size + (guard_size * 2)) > size) return false; -#if defined(WIN32) +#if defined(_WIN32) DWORD old_protect = 0; if (!VirtualProtect(buffer, size, PAGE_EXECUTE_READWRITE, &old_protect)) { @@ -156,7 +156,7 @@ void JitCodeBuffer::Destroy() { if (m_owns_buffer) { -#if defined(WIN32) +#if defined(_WIN32) VirtualFree(m_code_ptr, 0, MEM_RELEASE); #elif defined(__linux__) || defined(__ANDROID__) || defined(__APPLE__) || defined(__HAIKU__) || defined(__FreeBSD__) munmap(m_code_ptr, m_total_size); @@ -164,7 +164,7 @@ void JitCodeBuffer::Destroy() } else if (m_code_ptr) { -#if defined(WIN32) +#if defined(_WIN32) DWORD old_protect = 0; VirtualProtect(m_code_ptr, m_total_size, m_old_protection, &old_protect); #else @@ -237,7 +237,7 @@ void JitCodeBuffer::Align(u32 alignment, u8 padding_value) void JitCodeBuffer::FlushInstructionCache(void* address, u32 size) { -#if defined(WIN32) +#if defined(_WIN32) ::FlushInstructionCache(GetCurrentProcess(), address, size); #elif defined(__GNUC__) || defined(__clang__) __builtin___clear_cache(reinterpret_cast(address), reinterpret_cast(address) + size); diff --git a/src/common/log.cpp b/src/common/log.cpp index 07651bd58..cd4f36684 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -7,7 +7,7 @@ #include #include -#if defined(WIN32) +#if defined(_WIN32) #include "windows_headers.h" #elif defined(__ANDROID__) #include @@ -531,7 +531,7 @@ void Writev(const char* channelName, const char* functionName, LOGLEVEL level, c va_list apCopy; va_copy(apCopy, ap); -#ifdef WIN32 +#ifdef _WIN32 u32 requiredSize = static_cast(_vscprintf(format, apCopy)); #else u32 requiredSize = std::vsnprintf(nullptr, 0, format, apCopy); diff --git a/src/common/memory_arena.cpp b/src/common/memory_arena.cpp index a53b8f1b8..d89f388dc 100644 --- a/src/common/memory_arena.cpp +++ b/src/common/memory_arena.cpp @@ -4,7 +4,7 @@ #include "common/string_util.h" Log_SetChannel(Common::MemoryArena); -#if defined(WIN32) +#if defined(_WIN32) #include "common/windows_headers.h" #elif defined(ANDROID) #include @@ -69,7 +69,7 @@ MemoryArena::~MemoryArena() void* MemoryArena::FindBaseAddressForMapping(size_t size) { void* base_address; -#if defined(WIN32) +#if defined(_WIN32) base_address = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE); if (base_address) VirtualFree(base_address, 0, MEM_RELEASE); @@ -96,7 +96,7 @@ void* MemoryArena::FindBaseAddressForMapping(size_t size) bool MemoryArena::IsValid() const { -#if defined(WIN32) +#if defined(_WIN32) return m_file_handle != nullptr; #else return m_shmem_fd >= 0; @@ -217,7 +217,7 @@ bool MemoryArena::Create(size_t size, bool writable, bool executable) void MemoryArena::Destroy() { -#if defined(WIN32) +#if defined(_WIN32) if (m_file_handle) { CloseHandle(m_file_handle); @@ -255,7 +255,7 @@ void* MemoryArena::CreateViewPtr(size_t offset, size_t size, bool writable, bool void* fixed_address /*= nullptr*/) { void* base_pointer; -#if defined(WIN32) +#if defined(_WIN32) const DWORD desired_access = FILE_MAP_READ | (writable ? FILE_MAP_WRITE : 0) | (executable ? FILE_MAP_EXECUTE : 0); base_pointer = MapViewOfFileEx(m_file_handle, desired_access, Truncate32(offset >> 32), Truncate32(offset), size, fixed_address); @@ -277,7 +277,7 @@ void* MemoryArena::CreateViewPtr(size_t offset, size_t size, bool writable, bool bool MemoryArena::FlushViewPtr(void* address, size_t size) { -#if defined(WIN32) +#if defined(_WIN32) return FlushViewOfFile(address, size); #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) return (msync(address, size, 0) >= 0); @@ -289,7 +289,7 @@ bool MemoryArena::FlushViewPtr(void* address, size_t size) bool MemoryArena::ReleaseViewPtr(void* address, size_t size) { bool result; -#if defined(WIN32) +#if defined(_WIN32) result = static_cast(UnmapViewOfFile(address)); #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) result = (munmap(address, size) >= 0); @@ -311,7 +311,7 @@ bool MemoryArena::ReleaseViewPtr(void* address, size_t size) void* MemoryArena::CreateReservedPtr(size_t size, void* fixed_address /*= nullptr*/) { void* base_pointer; -#if defined(WIN32) +#if defined(_WIN32) base_pointer = VirtualAlloc(fixed_address, size, MEM_RESERVE, PAGE_NOACCESS); #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) const int flags = @@ -330,7 +330,7 @@ void* MemoryArena::CreateReservedPtr(size_t size, void* fixed_address /*= nullpt bool MemoryArena::ReleaseReservedPtr(void* address, size_t size) { bool result; -#if defined(WIN32) +#if defined(_WIN32) result = static_cast(VirtualFree(address, 0, MEM_RELEASE)); #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) result = (munmap(address, size) >= 0); @@ -351,7 +351,7 @@ bool MemoryArena::ReleaseReservedPtr(void* address, size_t size) bool MemoryArena::SetPageProtection(void* address, size_t length, bool readable, bool writable, bool executable) { -#if defined(WIN32) +#if defined(_WIN32) static constexpr DWORD protection_table[2][2][2] = { {{PAGE_NOACCESS, PAGE_EXECUTE}, {PAGE_WRITECOPY, PAGE_EXECUTE_WRITECOPY}}, {{PAGE_READONLY, PAGE_EXECUTE_READ}, {PAGE_READWRITE, PAGE_EXECUTE_READWRITE}}}; diff --git a/src/common/memory_arena.h b/src/common/memory_arena.h index 0d6a262f5..ce5ecfa39 100644 --- a/src/common/memory_arena.h +++ b/src/common/memory_arena.h @@ -60,7 +60,7 @@ public: static bool SetPageProtection(void* address, size_t length, bool readable, bool writable, bool executable); private: -#if defined(WIN32) +#if defined(_WIN32) void* m_file_handle = nullptr; #elif defined(__linux__) || defined(ANDROID) || defined(__APPLE__) || defined(__FreeBSD__) int m_shmem_fd = -1; diff --git a/src/common/page_fault_handler.cpp b/src/common/page_fault_handler.cpp index 1562bdfb3..9be882561 100644 --- a/src/common/page_fault_handler.cpp +++ b/src/common/page_fault_handler.cpp @@ -7,7 +7,7 @@ #include Log_SetChannel(Common::PageFaultHandler); -#if defined(WIN32) +#if defined(_WIN32) #include "windows_headers.h" #elif defined(__linux__) || defined(__ANDROID__) #include @@ -78,7 +78,7 @@ static bool IsStoreInstruction(const void* ptr) } #endif -#if defined(WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64)) +#if defined(_WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64)) static PVOID s_veh_handle; static LONG ExceptionHandler(PEXCEPTION_POINTERS exi) @@ -222,7 +222,7 @@ bool InstallHandler(void* owner, Callback callback) if (was_empty) { -#if defined(WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64)) +#if defined(_WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64)) s_veh_handle = AddVectoredExceptionHandler(1, ExceptionHandler); if (!s_veh_handle) { @@ -279,7 +279,7 @@ bool RemoveHandler(void* owner) if (m_handlers.empty()) { -#if defined(WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64)) +#if defined(_WIN32) && (defined(CPU_X64) || defined(CPU_AARCH64)) RemoveVectoredExceptionHandler(s_veh_handle); s_veh_handle = nullptr; #elif defined(USE_SIGSEGV) diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index c5b61d2cd..3dd73ac7e 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -4,7 +4,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include "windows_headers.h" #endif @@ -24,7 +24,7 @@ std::string StdStringFromFormatV(const char* format, std::va_list ap) std::va_list ap_copy; va_copy(ap_copy, ap); -#ifdef WIN32 +#ifdef _WIN32 int len = _vscprintf(format, ap_copy); #else int len = std::vsnprintf(nullptr, 0, format, ap_copy); @@ -190,7 +190,7 @@ std::string EncodeHex(const u8* data, int length) return ss.str(); } -#ifdef WIN32 +#ifdef _WIN32 std::wstring UTF8StringToWideString(const std::string_view& str) { diff --git a/src/common/string_util.h b/src/common/string_util.h index 02f75c291..5d96eca86 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -160,7 +160,7 @@ ALWAYS_INLINE static int StrideMemCmp(const void* p1, std::size_t p1_stride, con return 0; } -#ifdef WIN32 +#ifdef _WIN32 /// Converts the specified UTF-8 string to a wide string. std::wstring UTF8StringToWideString(const std::string_view& str); diff --git a/src/common/timer.cpp b/src/common/timer.cpp index fb323ccf1..22a3a10d0 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -2,7 +2,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include "windows_headers.h" #else #include @@ -12,7 +12,7 @@ namespace Common { -#ifdef WIN32 +#ifdef _WIN32 static double s_counter_frequency; static bool s_counter_initialized = false; @@ -250,7 +250,7 @@ void Timer::HybridSleep(std::uint64_t ns, std::uint64_t min_sleep_time) void Timer::NanoSleep(std::uint64_t ns) { -#if defined(WIN32) +#if defined(_WIN32) HANDLE timer = GetSleepTimer(); if (timer) { diff --git a/src/common/timestamp.cpp b/src/common/timestamp.cpp index d980a6585..329c3732c 100644 --- a/src/common/timestamp.cpp +++ b/src/common/timestamp.cpp @@ -2,7 +2,7 @@ #include #include -#if defined(WIN32) +#if defined(_WIN32) static void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst); static time_t SystemTimeToUnixTime(const SYSTEMTIME* pst); @@ -11,7 +11,7 @@ static time_t SystemTimeToUnixTime(const SYSTEMTIME* pst); Timestamp::Timestamp() { -#if defined(WIN32) +#if defined(_WIN32) m_value.wYear = 1970; m_value.wMonth = 1; m_value.wDayOfWeek = 0; @@ -28,7 +28,7 @@ Timestamp::Timestamp() Timestamp::Timestamp(const Timestamp& copy) { -#if defined(WIN32) +#if defined(_WIN32) std::memcpy(&m_value, ©.m_value, sizeof(m_value)); #else std::memcpy(&m_value, ©.m_value, sizeof(m_value)); @@ -37,7 +37,7 @@ Timestamp::Timestamp(const Timestamp& copy) double Timestamp::DifferenceInSeconds(Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) FILETIME lft, rft; SystemTimeToFileTime(&m_value, &lft); SystemTimeToFileTime(&other.m_value, &rft); @@ -55,7 +55,7 @@ double Timestamp::DifferenceInSeconds(Timestamp& other) const s64 Timestamp::DifferenceInSecondsInt(Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) FILETIME lft, rft; SystemTimeToFileTime(&m_value, &lft); SystemTimeToFileTime(&other.m_value, &rft); @@ -72,7 +72,7 @@ s64 Timestamp::DifferenceInSecondsInt(Timestamp& other) const Timestamp::UnixTimestampValue Timestamp::AsUnixTimestamp() const { -#if defined(WIN32) +#if defined(_WIN32) return (UnixTimestampValue)SystemTimeToUnixTime(&m_value); #else return (UnixTimestampValue)m_value.tv_sec; @@ -83,7 +83,7 @@ Timestamp::ExpandedTime Timestamp::AsExpandedTime() const { ExpandedTime et; -#if defined(WIN32) +#if defined(_WIN32) et.Year = m_value.wYear; et.Month = m_value.wMonth; et.DayOfMonth = m_value.wDay; @@ -111,7 +111,7 @@ Timestamp::ExpandedTime Timestamp::AsExpandedTime() const void Timestamp::SetNow() { -#if defined(WIN32) +#if defined(_WIN32) GetSystemTime(&m_value); #else gettimeofday(&m_value, NULL); @@ -120,7 +120,7 @@ void Timestamp::SetNow() void Timestamp::SetUnixTimestamp(UnixTimestampValue value) { -#if defined(WIN32) +#if defined(_WIN32) UnixTimeToSystemTime((time_t)value, &m_value); #else m_value.tv_sec = (time_t)value; @@ -130,7 +130,7 @@ void Timestamp::SetUnixTimestamp(UnixTimestampValue value) void Timestamp::SetExpandedTime(const ExpandedTime& value) { -#if defined(WIN32) +#if defined(_WIN32) // bit of a hacky way to fill in the missing fields SYSTEMTIME st; st.wYear = (WORD)value.Year; @@ -170,7 +170,7 @@ void Timestamp::ToString(String& destination, const char* format) const time_t unixTime = (time_t)AsUnixTimestamp(); tm localTime; -#if defined(WIN32) +#if defined(_WIN32) localtime_s(&localTime, &unixTime); #else localtime_r(&unixTime, &localTime); @@ -207,7 +207,7 @@ Timestamp Timestamp::FromExpandedTime(const ExpandedTime& value) bool Timestamp::operator==(const Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) return std::memcmp(&m_value, &other.m_value, sizeof(m_value)) == 0; #else return std::memcmp(&m_value, &other.m_value, sizeof(m_value)) == 0; @@ -221,7 +221,7 @@ bool Timestamp::operator!=(const Timestamp& other) const bool Timestamp::operator<(const Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) if (m_value.wYear > other.m_value.wYear) return false; @@ -279,7 +279,7 @@ bool Timestamp::operator<(const Timestamp& other) const bool Timestamp::operator<=(const Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) if (m_value.wYear > other.m_value.wYear) return false; @@ -337,7 +337,7 @@ bool Timestamp::operator<=(const Timestamp& other) const bool Timestamp::operator>(const Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) if (m_value.wYear < other.m_value.wYear) return false; @@ -395,7 +395,7 @@ bool Timestamp::operator>(const Timestamp& other) const bool Timestamp::operator>=(const Timestamp& other) const { -#if defined(WIN32) +#if defined(_WIN32) if (m_value.wYear < other.m_value.wYear) return false; @@ -453,7 +453,7 @@ bool Timestamp::operator>=(const Timestamp& other) const Timestamp& Timestamp::operator=(const Timestamp& other) { -#if defined(WIN32) +#if defined(_WIN32) std::memcpy(&m_value, &other.m_value, sizeof(m_value)); #else std::memcpy(&m_value, &other.m_value, sizeof(m_value)); @@ -462,7 +462,7 @@ Timestamp& Timestamp::operator=(const Timestamp& other) return *this; } -#if defined(WIN32) +#if defined(_WIN32) // http://support.microsoft.com/kb/167296 static void UnixTimeToFileTime(time_t t, LPFILETIME pft) diff --git a/src/common/timestamp.h b/src/common/timestamp.h index 73d4622c4..7f46036e8 100644 --- a/src/common/timestamp.h +++ b/src/common/timestamp.h @@ -2,7 +2,7 @@ #include "types.h" #include "string.h" -#if defined(WIN32) +#if defined(_WIN32) #include "windows_headers.h" #else #include @@ -51,7 +51,7 @@ public: static Timestamp FromExpandedTime(const ExpandedTime& value); // windows-specific -#ifdef WIN32 +#ifdef _WIN32 FILETIME AsFileTime(); void SetWindowsFileTime(const FILETIME* pFileTime); static Timestamp FromWindowsFileTime(const FILETIME* pFileTime); @@ -67,7 +67,7 @@ public: Timestamp& operator=(const Timestamp& other); private: -#if defined(WIN32) +#if defined(_WIN32) SYSTEMTIME m_value; #else struct timeval m_value; diff --git a/src/core/cpu_recompiler_types.h b/src/core/cpu_recompiler_types.h index a0214d7c7..46b9f82a3 100644 --- a/src/core/cpu_recompiler_types.h +++ b/src/core/cpu_recompiler_types.h @@ -5,7 +5,7 @@ #if defined(CPU_X64) // We need to include windows.h before xbyak does.. -#ifdef WIN32 +#ifdef _WIN32 #include "common/windows_headers.h" #endif @@ -81,7 +81,7 @@ constexpr u32 MAX_FAR_HOST_BYTES_PER_INSTRUCTION = 128; constexpr u32 CODE_STORAGE_ALIGNMENT = 4096; // ABI selection -#if defined(WIN32) +#if defined(_WIN32) #define ABI_WIN64 1 #elif defined(__linux__) || defined(__ANDROID__) || defined(__APPLE__) || defined(__HAIKU__) || defined(__FreeBSD__) #define ABI_SYSV 1 diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 1f8d3fd12..17c4b1188 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -650,12 +650,12 @@ const char* Settings::GetCPUFastmemModeDisplayName(CPUFastmemMode mode) } static constexpr auto s_gpu_renderer_names = make_array( -#ifdef WIN32 +#ifdef _WIN32 "D3D11", #endif "Vulkan", "OpenGL", "Software"); static constexpr auto s_gpu_renderer_display_names = make_array( -#ifdef WIN32 +#ifdef _WIN32 TRANSLATABLE("GPURenderer", "Hardware (D3D11)"), #endif TRANSLATABLE("GPURenderer", "Hardware (Vulkan)"), TRANSLATABLE("GPURenderer", "Hardware (OpenGL)"), diff --git a/src/core/system.cpp b/src/core/system.cpp index 9d2d94212..c558596dd 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1008,7 +1008,7 @@ bool CreateGPU(GPURenderer renderer) g_gpu = GPU::CreateHardwareVulkanRenderer(); break; -#ifdef WIN32 +#ifdef _WIN32 case GPURenderer::HardwareD3D11: g_gpu = GPU::CreateHardwareD3D11Renderer(); break; diff --git a/src/core/texture_replacements.cpp b/src/core/texture_replacements.cpp index fa2107597..66a7d3f19 100644 --- a/src/core/texture_replacements.cpp +++ b/src/core/texture_replacements.cpp @@ -183,7 +183,7 @@ bool TextureReplacements::ParseReplacementFilename(const std::string& filename, { const char* extension = std::strrchr(filename.c_str(), '.'); const char* title = std::strrchr(filename.c_str(), '/'); -#ifdef WIN32 +#ifdef _WIN32 const char* title2 = std::strrchr(filename.c_str(), '\\'); if (title2 && (!title || title2 > title)) title = title2; diff --git a/src/core/types.h b/src/core/types.h index ac74b44d8..c084e1607 100644 --- a/src/core/types.h +++ b/src/core/types.h @@ -54,7 +54,7 @@ enum class PGXPMode : u8 enum class GPURenderer : u8 { -#ifdef WIN32 +#ifdef _WIN32 HardwareD3D11, #endif HardwareVulkan, diff --git a/src/duckstation-nogui/nogui_host_interface.cpp b/src/duckstation-nogui/nogui_host_interface.cpp index 4ff243018..df33bf7a9 100644 --- a/src/duckstation-nogui/nogui_host_interface.cpp +++ b/src/duckstation-nogui/nogui_host_interface.cpp @@ -22,7 +22,7 @@ #include Log_SetChannel(NoGUIHostInterface); -#ifdef WIN32 +#ifdef _WIN32 #include "frontend-common/d3d11_host_display.h" #endif @@ -97,13 +97,13 @@ bool NoGUIHostInterface::CreateDisplay(bool fullscreen) break; case GPURenderer::HardwareOpenGL: -#ifndef WIN32 +#ifndef _WIN32 default: #endif m_display = std::make_unique(); break; -#ifdef WIN32 +#ifdef _WIN32 case GPURenderer::HardwareD3D11: default: m_display = std::make_unique(); @@ -151,7 +151,7 @@ bool NoGUIHostInterface::AcquireHostDisplay() bool needs_switch = false; switch (g_settings.gpu_renderer) { -#ifdef WIN32 +#ifdef _WIN32 case GPURenderer::HardwareD3D11: needs_switch = (render_api != HostDisplay::RenderAPI::D3D11); break; diff --git a/src/duckstation-qt/autoupdaterdialog.cpp b/src/duckstation-qt/autoupdaterdialog.cpp index 9a2ede929..cd52d89b6 100644 --- a/src/duckstation-qt/autoupdaterdialog.cpp +++ b/src/duckstation-qt/autoupdaterdialog.cpp @@ -25,7 +25,7 @@ Log_SetChannel(AutoUpdaterDialog); // Logic to detect whether we can use the auto updater. // Currently Windows-only, and requires that the channel be defined by the buildbot. -#ifdef WIN32 +#ifdef _WIN32 #if defined(__has_include) && __has_include("scmversion/tag.h") #include "scmversion/tag.h" #ifdef SCM_RELEASE_TAGS @@ -444,7 +444,7 @@ void AutoUpdaterDialog::remindMeLaterClicked() done(0); } -#ifdef WIN32 +#ifdef _WIN32 bool AutoUpdaterDialog::processUpdate(const QByteArray& update_data) { diff --git a/src/duckstation-qt/autoupdaterdialog.h b/src/duckstation-qt/autoupdaterdialog.h index 6f1f37ba7..4b578aa94 100644 --- a/src/duckstation-qt/autoupdaterdialog.h +++ b/src/duckstation-qt/autoupdaterdialog.h @@ -44,7 +44,7 @@ private: bool updateNeeded() const; std::string getCurrentUpdateTag() const; -#ifdef WIN32 +#ifdef _WIN32 bool processUpdate(const QByteArray& update_data); bool extractUpdater(const QString& zip_path, const QString& destination_path); bool doUpdate(const QString& zip_path, const QString& updater_path, const QString& destination_path); diff --git a/src/duckstation-qt/debuggerwindow.cpp b/src/duckstation-qt/debuggerwindow.cpp index 5ce024dfd..8a0d70846 100644 --- a/src/duckstation-qt/debuggerwindow.cpp +++ b/src/duckstation-qt/debuggerwindow.cpp @@ -359,7 +359,7 @@ void DebuggerWindow::closeEvent(QCloseEvent* event) void DebuggerWindow::setupAdditionalUi() { -#ifdef WIN32 +#ifdef _WIN32 QFont fixedFont; fixedFont.setFamily(QStringLiteral("Consolas")); fixedFont.setFixedPitch(true); diff --git a/src/duckstation-qt/displaysettingswidget.cpp b/src/duckstation-qt/displaysettingswidget.cpp index d158a40b3..4226984e9 100644 --- a/src/duckstation-qt/displaysettingswidget.cpp +++ b/src/duckstation-qt/displaysettingswidget.cpp @@ -9,7 +9,7 @@ // For enumerating adapters. #include "frontend-common/vulkan_host_display.h" -#ifdef WIN32 +#ifdef _WIN32 #include "frontend-common/d3d11_host_display.h" #endif @@ -202,7 +202,7 @@ void DisplaySettingsWidget::populateGPUAdaptersAndResolutions() bool threaded_presentation_supported = false; switch (static_cast(m_ui.renderer->currentIndex())) { -#ifdef WIN32 +#ifdef _WIN32 case GPURenderer::HardwareD3D11: aml = FrontendCommon::D3D11HostDisplay::StaticGetAdapterAndModeList(); break; diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 54ceb246a..0693d3bea 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -1626,7 +1626,7 @@ void MainWindow::checkForUpdates(bool display_message) mbox.setTextFormat(Qt::RichText); QString message; -#ifdef WIN32 +#ifdef _WIN32 message = tr("

Sorry, you are trying to update a DuckStation version which is not an official GitHub release. To " "prevent incompatibilities, the auto-updater is only enabled on official builds.

" diff --git a/src/duckstation-qt/qtdisplaywidget.cpp b/src/duckstation-qt/qtdisplaywidget.cpp index 78d997a8b..d92f8a317 100644 --- a/src/duckstation-qt/qtdisplaywidget.cpp +++ b/src/duckstation-qt/qtdisplaywidget.cpp @@ -10,7 +10,7 @@ #include #include -#if !defined(WIN32) && !defined(APPLE) +#if !defined(_WIN32) && !defined(APPLE) #include #endif @@ -56,7 +56,7 @@ std::optional QtDisplayWidget::getWindowInfo() const WindowInfo wi; // Windows and Apple are easy here since there's no display connection. -#if defined(WIN32) +#if defined(_WIN32) wi.type = WindowInfo::Type::Win32; wi.window_handle = reinterpret_cast(winId()); #elif defined(__APPLE__) diff --git a/src/duckstation-qt/qthostinterface.cpp b/src/duckstation-qt/qthostinterface.cpp index 60b8d44f9..fd321d3e7 100644 --- a/src/duckstation-qt/qthostinterface.cpp +++ b/src/duckstation-qt/qthostinterface.cpp @@ -39,7 +39,7 @@ #include Log_SetChannel(QtHostInterface); -#ifdef WIN32 +#ifdef _WIN32 #include "common/windows_headers.h" #include "frontend-common/d3d11_host_display.h" #include @@ -570,13 +570,13 @@ HostDisplay* QtHostInterface::createHostDisplay() break; case GPURenderer::HardwareOpenGL: -#ifndef WIN32 +#ifndef _WIN32 default: #endif m_display = std::make_unique(); break; -#ifdef WIN32 +#ifdef _WIN32 case GPURenderer::HardwareD3D11: default: m_display = std::make_unique(); @@ -1616,7 +1616,7 @@ void QtHostInterface::wakeThread() static std::string GetFontPath(const char* name) { -#ifdef WIN32 +#ifdef _WIN32 PWSTR folder_path; if (FAILED(SHGetKnownFolderPath(FOLDERID_Fonts, 0, nullptr, &folder_path))) return StringUtil::StdStringFromFormat("C:\\Windows\\Fonts\\%s", name); @@ -1637,7 +1637,7 @@ void QtHostInterface::setImGuiFont() std::string path; const ImWchar* range = nullptr; -#ifdef WIN32 +#ifdef _WIN32 if (language == "ja") { path = GetFontPath("msgothic.ttc"); diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 6ec637f88..a658fd4db 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -51,7 +51,7 @@ #include "cheevos.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include "common/windows_headers.h" #include #include @@ -926,7 +926,7 @@ void CommonHostInterface::SetUserDirectory() } else { -#if defined(WIN32) +#if defined(_WIN32) // On Windows, use My Documents\DuckStation. PWSTR documents_directory; if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, 0, NULL, &documents_directory))) @@ -3092,7 +3092,7 @@ void CommonHostInterface::SetTimerResolutionIncreased(bool enabled) m_timer_resolution_increased = enabled; -#ifdef WIN32 +#ifdef _WIN32 if (enabled) timeBeginPeriod(1); else diff --git a/src/frontend-common/controller_interface.cpp b/src/frontend-common/controller_interface.cpp index fedc0d4c7..a7fda44c8 100644 --- a/src/frontend-common/controller_interface.cpp +++ b/src/frontend-common/controller_interface.cpp @@ -109,7 +109,7 @@ static constexpr std::array(ControllerInterface::B #ifdef WITH_SDL2 TRANSLATABLE("ControllerInterface", "SDL"), #endif -#ifdef WIN32 +#ifdef _WIN32 TRANSLATABLE("ControllerInterface", "XInput"), TRANSLATABLE("ControllerInterface", "DInput"), #endif @@ -143,7 +143,7 @@ ControllerInterface::Backend ControllerInterface::GetDefaultBackend() #ifdef WITH_SDL2 return Backend::SDL; #else -#ifdef WIN32 +#ifdef _WIN32 return Backend::XInput; #else return Backend::None; @@ -154,7 +154,7 @@ ControllerInterface::Backend ControllerInterface::GetDefaultBackend() #ifdef WITH_SDL2 #include "sdl_controller_interface.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include "dinput_controller_interface.h" #include "xinput_controller_interface.h" #endif @@ -168,7 +168,7 @@ std::unique_ptr ControllerInterface::Create(Backend type) if (type == Backend::SDL) return std::make_unique(); #endif -#ifdef WIN32 +#ifdef _WIN32 if (type == Backend::XInput) return std::make_unique(); if (type == Backend::DInput) diff --git a/src/frontend-common/controller_interface.h b/src/frontend-common/controller_interface.h index dd73a8ac7..717a97361 100644 --- a/src/frontend-common/controller_interface.h +++ b/src/frontend-common/controller_interface.h @@ -21,7 +21,7 @@ public: #ifdef WITH_SDL2 SDL, #endif -#ifdef WIN32 +#ifdef _WIN32 XInput, DInput, #endif diff --git a/src/frontend-common/cubeb_audio_stream.cpp b/src/frontend-common/cubeb_audio_stream.cpp index f3d770355..099e62b5b 100644 --- a/src/frontend-common/cubeb_audio_stream.cpp +++ b/src/frontend-common/cubeb_audio_stream.cpp @@ -3,7 +3,7 @@ #include "common/log.h" Log_SetChannel(CubebAudioStream); -#ifdef WIN32 +#ifdef _WIN32 #include "common/windows_headers.h" #include #pragma comment(lib, "Ole32.lib") @@ -21,7 +21,7 @@ bool CubebAudioStream::OpenDevice() { Assert(!IsOpen()); -#ifdef WIN32 +#ifdef _WIN32 HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); m_com_initialized_by_us = SUCCEEDED(hr); if (FAILED(hr) && hr != RPC_E_CHANGED_MODE && hr != S_FALSE) @@ -150,7 +150,7 @@ void CubebAudioStream::DestroyContext() cubeb_destroy(m_cubeb_context); m_cubeb_context = nullptr; -#ifdef WIN32 +#ifdef _WIN32 if (m_com_initialized_by_us) CoUninitialize(); #endif diff --git a/src/frontend-common/cubeb_audio_stream.h b/src/frontend-common/cubeb_audio_stream.h index 830e044a7..f9bb7025d 100644 --- a/src/frontend-common/cubeb_audio_stream.h +++ b/src/frontend-common/cubeb_audio_stream.h @@ -30,7 +30,7 @@ protected: cubeb_stream* m_cubeb_stream = nullptr; bool m_paused = true; -#ifdef WIN32 +#ifdef _WIN32 bool m_com_initialized_by_us = false; #endif }; diff --git a/src/frontend-common/fullscreen_ui.cpp b/src/frontend-common/fullscreen_ui.cpp index bbd823d04..2184130e7 100644 --- a/src/frontend-common/fullscreen_ui.cpp +++ b/src/frontend-common/fullscreen_ui.cpp @@ -2054,7 +2054,7 @@ void DrawSettingsWindow() switch (s_settings_copy.gpu_renderer) { -#ifdef WIN32 +#ifdef _WIN32 case GPURenderer::HardwareD3D11: { settings_changed |= ToggleButtonForNonSetting( @@ -2463,7 +2463,7 @@ void DrawSettingsWindow() "Use Debug GPU Device", "Enable debugging when supported by the host's renderer API. Only for developer use.", &s_settings_copy.gpu_use_debug_device); -#ifdef WIN32 +#ifdef _WIN32 settings_changed |= ToggleButton("Increase Timer Resolution", "Enables more precise frame pacing at the cost of battery life.", &s_settings_copy.increase_timer_resolution); diff --git a/src/frontend-common/game_settings.cpp b/src/frontend-common/game_settings.cpp index 674f44ef0..9cc3746d8 100644 --- a/src/frontend-common/game_settings.cpp +++ b/src/frontend-common/game_settings.cpp @@ -11,7 +11,7 @@ #include Log_SetChannel(GameSettings); -#ifdef WIN32 +#ifdef _WIN32 #include "common/windows_headers.h" #endif #include "SimpleIni.h" diff --git a/src/frontend-common/ini_settings_interface.h b/src/frontend-common/ini_settings_interface.h index a4b934201..2faa3ed6e 100644 --- a/src/frontend-common/ini_settings_interface.h +++ b/src/frontend-common/ini_settings_interface.h @@ -2,7 +2,7 @@ #include "core/settings.h" // being a pain here... -#ifdef WIN32 +#ifdef _WIN32 #include "common/windows_headers.h" #endif #include "SimpleIni.h" diff --git a/src/updater/updater.cpp b/src/updater/updater.cpp index 53f1979de..599ecd8b4 100644 --- a/src/updater/updater.cpp +++ b/src/updater/updater.cpp @@ -12,7 +12,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #endif @@ -55,7 +55,7 @@ bool Updater::OpenUpdateZip(const char* path) bool Updater::RecursiveDeleteDirectory(const char* path) { -#ifdef WIN32 +#ifdef _WIN32 // making this safer on Win32... std::wstring wpath(StringUtil::UTF8StringToWideString(path)); wpath += L'\0'; @@ -286,7 +286,7 @@ bool Updater::CommitUpdate() const std::string dest_file_name = StringUtil::StdStringFromFormat( "%s" FS_OSPATH_SEPARATOR_STR "%s", m_destination_directory.c_str(), ftu.destination_filename.c_str()); m_progress->DisplayFormattedInformation("Moving '%s' to '%s'", staging_file_name.c_str(), dest_file_name.c_str()); -#ifdef WIN32 +#ifdef _WIN32 const bool result = MoveFileExW(StringUtil::UTF8StringToWideString(staging_file_name).c_str(), StringUtil::UTF8StringToWideString(dest_file_name).c_str(), MOVEFILE_REPLACE_EXISTING);