diff --git a/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h b/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h index 797de5fceb..f9d0cdbe4d 100644 --- a/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h +++ b/Code/Framework/AzCore/AzCore/std/parallel/binary_semaphore.h @@ -38,13 +38,13 @@ namespace AZStd binary_semaphore(bool initialState = false) { - m_event = CreateEvent(nullptr, false, initialState, nullptr); + m_event = CreateEventW(nullptr, false, initialState, nullptr); AZ_Assert(m_event != NULL, "CreateEvent error: %d\n", GetLastError()); } binary_semaphore(const char* name, bool initialState = false) { (void)name; // name is used only for debug, if we pass it to the semaphore it will become named semaphore - m_event = CreateEvent(nullptr, false, initialState, nullptr); + m_event = CreateEventW(nullptr, false, initialState, nullptr); AZ_Assert(m_event != NULL, "CreateEvent error: %d\n", GetLastError()); } diff --git a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/config_WinAPI.h b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/config_WinAPI.h index fb91e4d503..86117c0539 100644 --- a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/config_WinAPI.h +++ b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/config_WinAPI.h @@ -71,19 +71,11 @@ extern "C" using LPSECURITY_ATTRIBUTES = SECURITY_ATTRIBUTES*; // Semaphore - AZ_DLL_IMPORT HANDLE _stdcall CreateSemaphoreA(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCSTR lpName); AZ_DLL_IMPORT HANDLE _stdcall CreateSemaphoreW(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCWSTR lpName); AZ_DLL_IMPORT BOOL _stdcall ReleaseSemaphore(HANDLE hSemaphore, LONG lReleaseCount, LPLONG lpPreviousCount); - #ifndef CreateSemaphore - #define CreateSemaphore CreateSemaphoreW - #endif // Event - AZ_DLL_IMPORT HANDLE _stdcall CreateEventA(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName); AZ_DLL_IMPORT HANDLE _stdcall CreateEventW(LPSECURITY_ATTRIBUTES lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCWSTR lpName); - #ifndef CreateEvent - #define CreateEvent CreateEventW - #endif AZ_DLL_IMPORT BOOL _stdcall SetEvent(HANDLE); } diff --git a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/semaphore_WinAPI.h b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/semaphore_WinAPI.h index cca90787e6..cd6b216057 100644 --- a/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/semaphore_WinAPI.h +++ b/Code/Framework/AzCore/Platform/Common/WinAPI/AzCore/std/parallel/internal/semaphore_WinAPI.h @@ -15,14 +15,14 @@ namespace AZStd { inline semaphore::semaphore(unsigned int initialCount, unsigned int maximumCount) { - m_semaphore = CreateSemaphore(NULL, initialCount, maximumCount, 0); + m_semaphore = CreateSemaphoreW(NULL, initialCount, maximumCount, 0); AZ_Assert(m_semaphore != NULL, "CreateSemaphore error: %d\n", GetLastError()); } inline semaphore::semaphore(const char* name, unsigned int initialCount, unsigned int maximumCount) { (void)name; // name is used only for debug, if we pass it to the semaphore it will become named semaphore - m_semaphore = CreateSemaphore(NULL, initialCount, maximumCount, 0); + m_semaphore = CreateSemaphoreW(NULL, initialCount, maximumCount, 0); AZ_Assert(m_semaphore != NULL, "CreateSemaphore error: %d\n", GetLastError()); }