Browse Source

win32 compatibility tweaks.

tags/2021-05-28
jules 13 years ago
parent
commit
b83fcd7d5f
4 changed files with 18 additions and 9 deletions
  1. +2
    -2
      modules/juce_core/native/juce_win32_ComSmartPtr.h
  2. +1
    -1
      modules/juce_core/native/juce_win32_Registry.cpp
  3. +11
    -1
      modules/juce_core/native/juce_win32_SystemStats.cpp
  4. +4
    -5
      modules/juce_core/system/juce_TargetPlatform.h

+ 2
- 2
modules/juce_core/native/juce_win32_ComSmartPtr.h View File

@@ -131,12 +131,12 @@ public:
JUCE_COMRESULT QueryInterface (REFIID refId, void** result)
{
#if ! JUCE_MINGW
if (refId == __uuidof (ComClass)) { AddRef(); *result = dynamic_cast <ComClass*> (this); return S_OK; }
if (refId == __uuidof (ComClass)) { this->AddRef(); *result = dynamic_cast <ComClass*> (this); return S_OK; }
#else
jassertfalse; // need to find a mingw equivalent of __uuidof to make this possible
#endif
if (refId == IID_IUnknown) { AddRef(); *result = dynamic_cast <IUnknown*> (this); return S_OK; }
if (refId == IID_IUnknown) { this->AddRef(); *result = dynamic_cast <IUnknown*> (this); return S_OK; }
*result = 0;
return E_NOINTERFACE;


+ 1
- 1
modules/juce_core/native/juce_win32_Registry.cpp View File

@@ -131,7 +131,7 @@ String WindowsRegistry::getValue (const String& regValuePath, const String& defa
String WindowsRegistry::getValueWow64 (const String& regValuePath, const String& defaultValue)
{
return RegistryKeyWrapper::getValue (regValuePath, defaultValue, KEY_WOW64_64KEY);
return RegistryKeyWrapper::getValue (regValuePath, defaultValue, 0x100 /*KEY_WOW64_64KEY*/);
}
bool WindowsRegistry::setValue (const String& regValuePath, const String& value)


+ 11
- 1
modules/juce_core/native/juce_win32_SystemStats.cpp View File

@@ -403,4 +403,14 @@ static String getLocaleValue (LCID locale, LCTYPE key, const char* defaultValue)
String SystemStats::getUserLanguage() { return getLocaleValue (LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, "en"); }
String SystemStats::getUserRegion() { return getLocaleValue (LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, "US"); }
String SystemStats::getDisplayLanguage() { return getLocaleValue (MAKELCID (GetUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SISO639LANGNAME, "en"); }
String SystemStats::getDisplayLanguage()
{
DynamicLibrary dll ("kernel32.dll");
JUCE_LOAD_WINAPI_FUNCTION (dll, GetUserDefaultUILanguage, getUserDefaultUILanguage, LANGID, (void))
if (getUserDefaultUILanguage != nullptr)
return getLocaleValue (MAKELCID (getUserDefaultUILanguage(), SORT_DEFAULT), LOCALE_SISO639LANGNAME, "en");
return "en";
}

+ 4
- 5
modules/juce_core/system/juce_TargetPlatform.h View File

@@ -166,7 +166,10 @@
//==============================================================================
// Compiler type macros.
#ifdef __GNUC__
#ifdef __clang__
#define JUCE_CLANG 1
#define JUCE_GCC 1
#elif defined (__GNUC__)
#define JUCE_GCC 1
#elif defined (_MSC_VER)
#define JUCE_MSVC 1
@@ -190,8 +193,4 @@
#error unknown compiler
#endif
#ifdef __clang__
#define JUCE_CLANG 1
#endif
#endif // __JUCE_TARGETPLATFORM_JUCEHEADER__

Loading…
Cancel
Save