From 03c81655c640d190ceb78ce47cb7a98c0c4c434c Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 24 Aug 2012 09:23:50 +0100 Subject: [PATCH] Minor clean-ups. --- modules/juce_core/native/juce_win32_SystemStats.cpp | 9 +++++---- modules/juce_core/native/juce_win32_Threads.cpp | 6 +++--- modules/juce_core/threads/juce_ThreadLocalValue.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index c325fd2e40..b0730c6825 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -180,18 +180,19 @@ String SystemStats::getOperatingSystemName() bool SystemStats::isOperatingSystem64Bit() { - #ifdef _WIN64 + #if JUCE_64BIT return true; #else typedef BOOL (WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); - LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandle (_T("kernel32")), "IsWow64Process"); + LPFN_ISWOW64PROCESS fnIsWow64Process + = (LPFN_ISWOW64PROCESS) GetProcAddress (GetModuleHandleA ("kernel32"), "IsWow64Process"); BOOL isWow64 = FALSE; - return fnIsWow64Process != 0 + return fnIsWow64Process != nullptr && fnIsWow64Process (GetCurrentProcess(), &isWow64) - && (isWow64 != FALSE); + && isWow64 != FALSE; #endif } diff --git a/modules/juce_core/native/juce_win32_Threads.cpp b/modules/juce_core/native/juce_win32_Threads.cpp index 4b0cfd95b0..950cb9b0a7 100644 --- a/modules/juce_core/native/juce_win32_Threads.cpp +++ b/modules/juce_core/native/juce_win32_Threads.cpp @@ -287,7 +287,7 @@ static void* currentModuleHandle = nullptr; void* Process::getCurrentModuleInstanceHandle() noexcept { if (currentModuleHandle == nullptr) - currentModuleHandle = GetModuleHandle (0); + currentModuleHandle = GetModuleHandleA (nullptr); return currentModuleHandle; } @@ -319,8 +319,8 @@ void Process::terminate() bool juce_IsRunningInWine() { - HMODULE ntdll = GetModuleHandle (_T("ntdll.dll")); - return ntdll != 0 && GetProcAddress (ntdll, "wine_get_version") != 0; + HMODULE ntdll = GetModuleHandleA ("ntdll"); + return ntdll != 0 && GetProcAddress (ntdll, "wine_get_version") != nullptr; } //============================================================================== diff --git a/modules/juce_core/threads/juce_ThreadLocalValue.h b/modules/juce_core/threads/juce_ThreadLocalValue.h index 84c45b96e8..c6a5e8b45b 100644 --- a/modules/juce_core/threads/juce_ThreadLocalValue.h +++ b/modules/juce_core/threads/juce_ThreadLocalValue.h @@ -27,7 +27,7 @@ #define __JUCE_THREADLOCALVALUE_JUCEHEADER__ // (NB: on win32, native thread-locals aren't possible in a dynamically loaded DLL in XP). -#if ! ((JUCE_MSVC && (defined (_WIN64) || ! defined (JucePlugin_PluginCode))) \ +#if ! ((JUCE_MSVC && (JUCE_64BIT || ! defined (JucePlugin_PluginCode))) \ || (JUCE_MAC && JUCE_CLANG && defined (MAC_OS_X_VERSION_10_7) \ && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)) #define JUCE_NO_COMPILER_THREAD_LOCAL 1