Browse Source

MinGW: Fixed some 32 bit build errors

tags/2021-05-28
tpoole 8 years ago
parent
commit
47698a86b1
9 changed files with 60 additions and 22 deletions
  1. +1
    -1
      examples/Demo/Source/Demos/VideoDemo.cpp
  2. +2
    -0
      modules/juce_core/juce_core.cpp
  3. +14
    -9
      modules/juce_core/native/juce_win32_Network.cpp
  4. +8
    -0
      modules/juce_core/native/juce_win32_SystemStats.cpp
  5. +5
    -0
      modules/juce_core/system/juce_StandardHeader.h
  6. +1
    -1
      modules/juce_core/text/juce_CharPointer_UTF8.h
  7. +14
    -9
      modules/juce_core/text/juce_CharacterFunctions.h
  8. +1
    -0
      modules/juce_graphics/juce_graphics.cpp
  9. +14
    -2
      modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp

+ 1
- 1
examples/Demo/Source/Demos/VideoDemo.cpp View File

@@ -26,7 +26,7 @@
#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..


+ 2
- 0
modules/juce_core/juce_core.cpp View File

@@ -61,6 +61,8 @@
#if JUCE_MINGW
#include <ws2spi.h>
#include <cstdio>
#include <locale.h>
#endif
#else


+ 14
- 9
modules/juce_core/native/juce_win32_Network.cpp View File

@@ -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)
@@ -541,9 +552,7 @@ void IPAddress::findAllAddresses (Array<IPAddress>& result, bool includeIPv6)
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;
}
@@ -570,9 +579,7 @@ void IPAddress::findAllAddresses (Array<IPAddress>& result, bool includeIPv6)
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;
}
@@ -599,9 +606,7 @@ void IPAddress::findAllAddresses (Array<IPAddress>& result, bool includeIPv6)
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;
}


+ 8
- 0
modules/juce_core/native/juce_win32_SystemStats.cpp View File

@@ -107,6 +107,13 @@ String SystemStats::getCpuModel()
static int findNumberOfPhysicalCores() noexcept
{
#if JUCE_MINGW
// Not implemented in MinGW
jassertfalse;
return 1;
#else
int numPhysicalCores = 0;
DWORD bufferSize = 0;
GetLogicalProcessorInformation (nullptr, &bufferSize);
@@ -122,6 +129,7 @@ static int findNumberOfPhysicalCores() noexcept
}
return numPhysicalCores;
#endif // JUCE_MINGW
}
//==============================================================================


+ 5
- 0
modules/juce_core/system/juce_StandardHeader.h View File

@@ -114,6 +114,11 @@
#include "../misc/juce_StdFunctionCompat.h"
#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
#if JUCE_ATOMIC_AVAILABLE
#include <atomic>


+ 1
- 1
modules/juce_core/text/juce_CharPointer_UTF8.h View File

@@ -471,7 +471,7 @@ public:
/** Parses this string as a 64-bit integer. */
int64 getIntValue64() const noexcept
{
#if JUCE_WINDOWS
#if JUCE_WINDOWS && ! JUCE_MINGW
return _atoi64 (data);
#else
return atoll (data);


+ 14
- 9
modules/juce_core/text/juce_CharacterFunctions.h View File

@@ -231,17 +231,22 @@ public:
*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
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
}
/** Parses a character string, to read a floating-point value. */


+ 1
- 0
modules/juce_graphics/juce_graphics.cpp View File

@@ -68,6 +68,7 @@
#if JUCE_MINGW
#include <malloc.h>
#include <cstdio>
#endif
#ifdef JUCE_MSVC


+ 14
- 2
modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp View File

@@ -30,6 +30,12 @@ namespace juce
JUCE_DECLARE_UUID_GETTER (DWebBrowserEvents2, "34A715A0-6587-11D0-924A-0020AFC7AC4D")
JUCE_DECLARE_UUID_GETTER (IConnectionPointContainer, "B196B284-BAB4-101A-B69C-00AA00341D07")
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")
class WebBrowserComponent::Pimpl : public ActiveXControlComponent
@@ -392,12 +398,18 @@ void WebBrowserComponent::clearCookies()
{
HeapBlock<::INTERNET_CACHE_ENTRY_INFO> entry;
::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)
{
entry.realloc (1, entrySize);
urlCacheHandle = ::FindFirstUrlCacheEntry (TEXT ("cookie:"), entry.getData(), &entrySize);
urlCacheHandle = ::FindFirstUrlCacheEntry (searchPattern, entry.getData(), &entrySize);
}
if (urlCacheHandle != nullptr)


Loading…
Cancel
Save