mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
win32 compatibility tweaks.
This commit is contained in:
parent
41f3b6c485
commit
b83fcd7d5f
4 changed files with 18 additions and 9 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue