| @@ -26,7 +26,7 @@ | |||||
| #include "../JuceDemoHeader.h" | #include "../JuceDemoHeader.h" | ||||
| #if JUCE_MAC || JUCE_WINDOWS | |||||
| #if JUCE_MAC || (JUCE_WINDOWS && ! JUCE_MINGW) | |||||
| //============================================================================== | //============================================================================== | ||||
| // so that we can easily have two video windows each with a file browser, wrap this up as a class.. | // so that we can easily have two video windows each with a file browser, wrap this up as a class.. | ||||
| @@ -61,6 +61,8 @@ | |||||
| #if JUCE_MINGW | #if JUCE_MINGW | ||||
| #include <ws2spi.h> | #include <ws2spi.h> | ||||
| #include <cstdio> | |||||
| #include <locale.h> | |||||
| #endif | #endif | ||||
| #else | #else | ||||
| @@ -503,6 +503,17 @@ namespace MACAddressHelpers | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void split (const sockaddr_in6* sa_in6, int off, uint8* split) | |||||
| { | |||||
| #if JUCE_MINGW | |||||
| split[0] = sa_in6->sin6_addr._S6_un._S6_u8[off + 1]; | |||||
| split[1] = sa_in6->sin6_addr._S6_un._S6_u8[off]; | |||||
| #else | |||||
| split[0] = sa_in6->sin6_addr.u.Byte[off + 1]; | |||||
| split[1] = sa_in6->sin6_addr.u.Byte[off]; | |||||
| #endif | |||||
| } | |||||
| } | } | ||||
| void MACAddress::findAllAddresses (Array<MACAddress>& result) | void MACAddress::findAllAddresses (Array<MACAddress>& result) | ||||
| @@ -541,9 +552,7 @@ void IPAddress::findAllAddresses (Array<IPAddress>& result, bool includeIPv6) | |||||
| for (int i = 0; i < 8; ++i) | for (int i = 0; i < 8; ++i) | ||||
| { | { | ||||
| temp.split[0] = sa_in6->sin6_addr.u.Byte[i * 2 + 1]; | |||||
| temp.split[1] = sa_in6->sin6_addr.u.Byte[i * 2]; | |||||
| MACAddressHelpers::split (sa_in6, i * 2, temp.split); | |||||
| arr[i] = temp.combined; | arr[i] = temp.combined; | ||||
| } | } | ||||
| @@ -570,9 +579,7 @@ void IPAddress::findAllAddresses (Array<IPAddress>& result, bool includeIPv6) | |||||
| for (int i = 0; i < 8; ++i) | for (int i = 0; i < 8; ++i) | ||||
| { | { | ||||
| temp.split[0] = sa_in6->sin6_addr.u.Byte[i * 2 + 1]; | |||||
| temp.split[1] = sa_in6->sin6_addr.u.Byte[i * 2]; | |||||
| MACAddressHelpers::split (sa_in6, i * 2, temp.split); | |||||
| arr[i] = temp.combined; | arr[i] = temp.combined; | ||||
| } | } | ||||
| @@ -599,9 +606,7 @@ void IPAddress::findAllAddresses (Array<IPAddress>& result, bool includeIPv6) | |||||
| for (int i = 0; i < 8; ++i) | for (int i = 0; i < 8; ++i) | ||||
| { | { | ||||
| temp.split[0] = sa_in6->sin6_addr.u.Byte[i * 2 + 1]; | |||||
| temp.split[1] = sa_in6->sin6_addr.u.Byte[i * 2]; | |||||
| MACAddressHelpers::split (sa_in6, i * 2, temp.split); | |||||
| arr[i] = temp.combined; | arr[i] = temp.combined; | ||||
| } | } | ||||
| @@ -107,6 +107,13 @@ String SystemStats::getCpuModel() | |||||
| static int findNumberOfPhysicalCores() noexcept | static int findNumberOfPhysicalCores() noexcept | ||||
| { | { | ||||
| #if JUCE_MINGW | |||||
| // Not implemented in MinGW | |||||
| jassertfalse; | |||||
| return 1; | |||||
| #else | |||||
| int numPhysicalCores = 0; | int numPhysicalCores = 0; | ||||
| DWORD bufferSize = 0; | DWORD bufferSize = 0; | ||||
| GetLogicalProcessorInformation (nullptr, &bufferSize); | GetLogicalProcessorInformation (nullptr, &bufferSize); | ||||
| @@ -122,6 +129,7 @@ static int findNumberOfPhysicalCores() noexcept | |||||
| } | } | ||||
| return numPhysicalCores; | return numPhysicalCores; | ||||
| #endif // JUCE_MINGW | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -114,6 +114,11 @@ | |||||
| #include "../misc/juce_StdFunctionCompat.h" | #include "../misc/juce_StdFunctionCompat.h" | ||||
| #endif | #endif | ||||
| // The live build fails to compile std::stringstream | |||||
| #if ! JUCE_PROJUCER_LIVE_BUILD | |||||
| #include <sstream> | |||||
| #endif | |||||
| // Include std::atomic if it's supported by the compiler | // Include std::atomic if it's supported by the compiler | ||||
| #if JUCE_ATOMIC_AVAILABLE | #if JUCE_ATOMIC_AVAILABLE | ||||
| #include <atomic> | #include <atomic> | ||||
| @@ -471,7 +471,7 @@ public: | |||||
| /** Parses this string as a 64-bit integer. */ | /** Parses this string as a 64-bit integer. */ | ||||
| int64 getIntValue64() const noexcept | int64 getIntValue64() const noexcept | ||||
| { | { | ||||
| #if JUCE_WINDOWS | |||||
| #if JUCE_WINDOWS && ! JUCE_MINGW | |||||
| return _atoi64 (data); | return _atoi64 (data); | ||||
| #else | #else | ||||
| return atoll (data); | return atoll (data); | ||||
| @@ -231,17 +231,22 @@ public: | |||||
| *currentCharacter++ = '0'; | *currentCharacter++ = '0'; | ||||
| } | } | ||||
| #if JUCE_WINDOWS | |||||
| static _locale_t locale = _create_locale (LC_ALL, "C"); | |||||
| return _strtod_l (&buffer[0], nullptr, locale); | |||||
| #else | |||||
| static locale_t locale = newlocale (LC_ALL_MASK, "C", nullptr); | |||||
| #if JUCE_ANDROID | |||||
| return (double) strtold_l (&buffer[0], nullptr, locale); | |||||
| #if JUCE_PROJUCER_LIVE_BUILD | |||||
| // This will change with locale! | |||||
| return strtod (&buffer[0], nullptr); | |||||
| #else | #else | ||||
| return strtod_l (&buffer[0], nullptr, locale); | |||||
| double result = 0; | |||||
| const size_t stringSize = (size_t) (currentCharacter - &buffer[0]) + 1; | |||||
| if (stringSize > 1) | |||||
| { | |||||
| std::istringstream is (std::string (&buffer[0], stringSize)); | |||||
| is.imbue (std::locale ("C")); | |||||
| is >> result; | |||||
| } | |||||
| return result; | |||||
| #endif | #endif | ||||
| #endif | |||||
| } | } | ||||
| /** Parses a character string, to read a floating-point value. */ | /** Parses a character string, to read a floating-point value. */ | ||||
| @@ -68,6 +68,7 @@ | |||||
| #if JUCE_MINGW | #if JUCE_MINGW | ||||
| #include <malloc.h> | #include <malloc.h> | ||||
| #include <cstdio> | |||||
| #endif | #endif | ||||
| #ifdef JUCE_MSVC | #ifdef JUCE_MSVC | ||||
| @@ -30,6 +30,12 @@ namespace juce | |||||
| JUCE_DECLARE_UUID_GETTER (DWebBrowserEvents2, "34A715A0-6587-11D0-924A-0020AFC7AC4D") | JUCE_DECLARE_UUID_GETTER (DWebBrowserEvents2, "34A715A0-6587-11D0-924A-0020AFC7AC4D") | ||||
| JUCE_DECLARE_UUID_GETTER (IConnectionPointContainer, "B196B284-BAB4-101A-B69C-00AA00341D07") | JUCE_DECLARE_UUID_GETTER (IConnectionPointContainer, "B196B284-BAB4-101A-B69C-00AA00341D07") | ||||
| JUCE_DECLARE_UUID_GETTER (IWebBrowser2, "D30C1661-CDAF-11D0-8A3E-00C04FC9E26E") | JUCE_DECLARE_UUID_GETTER (IWebBrowser2, "D30C1661-CDAF-11D0-8A3E-00C04FC9E26E") | ||||
| #if JUCE_MINGW | |||||
| #define DISPID_NAVIGATEERROR 271 | |||||
| class WebBrowser; | |||||
| #endif | |||||
| JUCE_DECLARE_UUID_GETTER (WebBrowser, "8856F961-340A-11D0-A96B-00C04FD705A2") | JUCE_DECLARE_UUID_GETTER (WebBrowser, "8856F961-340A-11D0-A96B-00C04FD705A2") | ||||
| class WebBrowserComponent::Pimpl : public ActiveXControlComponent | class WebBrowserComponent::Pimpl : public ActiveXControlComponent | ||||
| @@ -392,12 +398,18 @@ void WebBrowserComponent::clearCookies() | |||||
| { | { | ||||
| HeapBlock<::INTERNET_CACHE_ENTRY_INFO> entry; | HeapBlock<::INTERNET_CACHE_ENTRY_INFO> entry; | ||||
| ::DWORD entrySize = sizeof (::INTERNET_CACHE_ENTRY_INFO); | ::DWORD entrySize = sizeof (::INTERNET_CACHE_ENTRY_INFO); | ||||
| ::HANDLE urlCacheHandle = ::FindFirstUrlCacheEntry (TEXT ("cookie:"), entry.getData(), &entrySize); | |||||
| #if JUCE_MINGW | |||||
| const auto searchPattern = "cookie:"; | |||||
| #else | |||||
| const auto searchPattern = TEXT ("cookie:"); | |||||
| #endif | |||||
| ::HANDLE urlCacheHandle = ::FindFirstUrlCacheEntry (searchPattern, entry.getData(), &entrySize); | |||||
| if (urlCacheHandle == nullptr && GetLastError() == ERROR_INSUFFICIENT_BUFFER) | if (urlCacheHandle == nullptr && GetLastError() == ERROR_INSUFFICIENT_BUFFER) | ||||
| { | { | ||||
| entry.realloc (1, entrySize); | entry.realloc (1, entrySize); | ||||
| urlCacheHandle = ::FindFirstUrlCacheEntry (TEXT ("cookie:"), entry.getData(), &entrySize); | |||||
| urlCacheHandle = ::FindFirstUrlCacheEntry (searchPattern, entry.getData(), &entrySize); | |||||
| } | } | ||||
| if (urlCacheHandle != nullptr) | if (urlCacheHandle != nullptr) | ||||