1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Workarounds for a few mingw warnings and errors.

This commit is contained in:
jules 2013-03-28 21:40:41 +00:00
parent 2451b3762c
commit 01d123d1e8
7 changed files with 27 additions and 11 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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)

View file

@ -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);

View file

@ -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;

View file

@ -44,6 +44,11 @@
#import <QuartzCore/QuartzCore.h>
#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 <dwrite.h>
#endif
#if JUCE_MINGW
#include <malloc.h>
#endif
#elif JUCE_IOS
#import <QuartzCore/QuartzCore.h>
#import <CoreText/CoreText.h>

View file

@ -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);