diff --git a/modules/juce_audio_devices/juce_audio_devices.cpp b/modules/juce_audio_devices/juce_audio_devices.cpp index d7caabb3f8..d42cbd73a5 100644 --- a/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/modules/juce_audio_devices/juce_audio_devices.cpp @@ -57,6 +57,11 @@ //============================================================================== #elif JUCE_WINDOWS + #if JUCE_MINGW && JUCE_WASAPI + #warning "WASAPI not currently implemented with mingw..." + #undef JUCE_WASAPI + #endif + #if JUCE_WASAPI #pragma warning (push) #pragma warning (disable: 4201) diff --git a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp index 1953581944..8158133208 100644 --- a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp +++ b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp @@ -531,13 +531,11 @@ public: void close() { - HRESULT hr; - if (pInputBuffer != nullptr) { JUCE_DS_LOG ("closing input: " + name); - hr = pInputBuffer->Stop(); - JUCE_DS_LOG_ERROR (hr); + HRESULT hr = pInputBuffer->Stop(); + JUCE_DS_LOG_ERROR (hr); (void) hr; pInputBuffer->Release(); pInputBuffer = nullptr; diff --git a/modules/juce_audio_devices/native/juce_win32_Midi.cpp b/modules/juce_audio_devices/native/juce_win32_Midi.cpp index 143855f13c..76cd261395 100644 --- a/modules/juce_audio_devices/native/juce_win32_Midi.cpp +++ b/modules/juce_audio_devices/native/juce_win32_Midi.cpp @@ -151,6 +151,7 @@ private: hdr.dwBytesRecorded = 0; MMRESULT res = midiInPrepareHeader (deviceHandle, &hdr, sizeof (hdr)); res = midiInAddBuffer (deviceHandle, &hdr, sizeof (hdr)); + (void) res; } void writeIfFinished (HMIDIIN deviceHandle) diff --git a/modules/juce_core/native/juce_win32_Network.cpp b/modules/juce_core/native/juce_win32_Network.cpp index 599adbef16..f023b1b7a1 100644 --- a/modules/juce_core/native/juce_win32_Network.cpp +++ b/modules/juce_core/native/juce_win32_Network.cpp @@ -375,7 +375,8 @@ namespace MACAddressHelpers NAME_BUFFER NameBuff [30]; }; - ASTAT astat = { 0 }; + ASTAT astat; + zerostruct (astat); ncb.ncb_buffer = (unsigned char*) &astat; ncb.ncb_length = sizeof (ASTAT); diff --git a/modules/juce_core/network/juce_Socket.cpp b/modules/juce_core/network/juce_Socket.cpp index 52a6c258cb..807384c09a 100644 --- a/modules/juce_core/network/juce_Socket.cpp +++ b/modules/juce_core/network/juce_Socket.cpp @@ -34,8 +34,10 @@ #if JUCE_WINDOWS typedef int juce_socklen_t; + typedef SOCKET SocketHandle; #else typedef socklen_t juce_socklen_t; + typedef int SocketHandle; #endif //============================================================================== @@ -57,7 +59,7 @@ namespace SocketHelpers #endif } - static bool resetSocketOptions (const int handle, const bool isDatagram, const bool allowBroadcast) noexcept + static bool resetSocketOptions (const SocketHandle handle, const bool isDatagram, const bool allowBroadcast) noexcept { const int sndBufSize = 65536; const int rcvBufSize = 65536; @@ -70,7 +72,7 @@ namespace SocketHelpers : (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0)); } - static bool bindSocketToPort (const int handle, const int port) noexcept + static bool bindSocketToPort (const SocketHandle handle, const int port) noexcept { if (handle <= 0 || port <= 0) return false; @@ -84,7 +86,7 @@ namespace SocketHelpers return bind (handle, (struct sockaddr*) &servTmpAddr, sizeof (struct sockaddr_in)) >= 0; } - static int readSocket (const int handle, + static int readSocket (const SocketHandle handle, void* const destBuffer, const int maxBytesToRead, bool volatile& connected, const bool blockUntilSpecifiedAmountHasArrived) noexcept @@ -122,7 +124,7 @@ namespace SocketHelpers return bytesRead; } - static int waitForReadiness (const int handle, const bool forReading, const int timeoutMsecs) noexcept + static int waitForReadiness (const SocketHandle handle, const bool forReading, const int timeoutMsecs) noexcept { struct timeval timeout; struct timeval* timeoutp; @@ -175,7 +177,7 @@ namespace SocketHelpers return FD_ISSET (handle, forReading ? &rset : &wset) ? 1 : 0; } - static bool setSocketBlockingState (const int handle, const bool shouldBlock) noexcept + static bool setSocketBlockingState (const SocketHandle handle, const bool shouldBlock) noexcept { #if JUCE_WINDOWS u_long nonBlocking = shouldBlock ? 0 : (u_long) 1; diff --git a/modules/juce_graphics/juce_graphics.cpp b/modules/juce_graphics/juce_graphics.cpp index c05e75e0ef..7d34c11988 100644 --- a/modules/juce_graphics/juce_graphics.cpp +++ b/modules/juce_graphics/juce_graphics.cpp @@ -44,6 +44,11 @@ #import #elif JUCE_WINDOWS + #if JUCE_MINGW && JUCE_USE_DIRECTWRITE + #warning "DirectWrite not currently implemented with mingw..." + #undef JUCE_USE_DIRECTWRITE + #endif + #if JUCE_USE_DIRECTWRITE /* If you hit a compile error trying to include these files, you may need to update your version of the Windows SDK to the latest one. The DirectWrite and Direct2D @@ -53,6 +58,10 @@ #include #endif + #if JUCE_MINGW + #include + #endif + #elif JUCE_IOS #import #import diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index a849a6f228..bbfbb5cd82 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -470,6 +470,7 @@ public: HWNDComponentPeer (Component& comp, const int windowStyleFlags, HWND parent, bool nonRepainting) : ComponentPeer (comp, windowStyleFlags), dontRepaint (nonRepainting), + parentToAddTo (parent), currentRenderingEngine (softwareRenderingEngine), lastPaintTime (0), fullScreen (false), @@ -479,7 +480,6 @@ public: constrainerIsResizing (false), currentWindowIcon (0), dropTarget (nullptr), - parentToAddTo (parent), updateLayeredWindowAlpha (255) { callFunctionIfNotLocked (&createWindowCallback, this);