diff --git a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp index 34f30d7b61..fb6e97f051 100644 --- a/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp +++ b/modules/juce_audio_devices/native/juce_win32_DirectSound.cpp @@ -514,7 +514,6 @@ private: IDirectSoundBuffer* pOutputBuffer; DWORD writeOffset; int totalBytesPerBuffer, bytesPerBuffer; - unsigned int lastPlayCursor; bool firstPlayTime; int64 lastPlayTime, ticksPerBuffer; @@ -1215,13 +1214,13 @@ public: initialiseDSoundFunctions(); } - void scanForDevices() + void scanForDevices() override { hasScanned = true; deviceList.scan(); } - StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const override { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1229,13 +1228,13 @@ public: : deviceList.outputDeviceNames; } - int getDefaultDeviceIndex (bool /*forInput*/) const + int getDefaultDeviceIndex (bool /*forInput*/) const override { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; } - int getIndexOfDevice (AudioIODevice* device, bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const override { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1246,10 +1245,10 @@ public: return -1; } - bool hasSeparateInputsAndOutputs() const { return true; } + bool hasSeparateInputsAndOutputs() const override { return true; } AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) + const String& inputDeviceName) override { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp index 3ac6f36e3b..d7de74c42d 100644 --- a/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp +++ b/modules/juce_audio_devices/native/juce_win32_WASAPI.cpp @@ -1445,7 +1445,7 @@ public: } //============================================================================== - void scanForDevices() + void scanForDevices() override { hasScanned = true; @@ -1458,7 +1458,7 @@ public: outputDeviceIds, inputDeviceIds); } - StringArray getDeviceNames (bool wantInputNames) const + StringArray getDeviceNames (bool wantInputNames) const override { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1466,13 +1466,13 @@ public: : outputDeviceNames; } - int getDefaultDeviceIndex (bool /*forInput*/) const + int getDefaultDeviceIndex (bool /*forInput*/) const override { jassert (hasScanned); // need to call scanForDevices() before doing this return 0; } - int getIndexOfDevice (AudioIODevice* device, bool asInput) const + int getIndexOfDevice (AudioIODevice* device, bool asInput) const override { jassert (hasScanned); // need to call scanForDevices() before doing this @@ -1483,10 +1483,10 @@ public: return -1; } - bool hasSeparateInputsAndOutputs() const { return true; } + bool hasSeparateInputsAndOutputs() const override { return true; } AudioIODevice* createDevice (const String& outputDeviceName, - const String& inputDeviceName) + const String& inputDeviceName) override { jassert (hasScanned); // need to call scanForDevices() before doing this diff --git a/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h b/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h index 412ca7622f..4997d657ff 100644 --- a/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h +++ b/modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.2/lib/os.h @@ -145,7 +145,7 @@ static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){ /* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be done safely because all x86_64 CPUs supports SSE2. */ -#if (! JUCE_PROJUCER_LIVE_BUILD) && ((defined(_MSC_VER) && defined(_WIN64)) || (defined(__GNUC__) && defined (__x86_64__))) +#if ! JUCE_PROJUCER_LIVE_BUILD && ((JUCE_MSVC && JUCE_64BIT) || (JUCE_GCC && defined (__x86_64__))) # define VORBIS_FPU_CONTROL typedef ogg_int16_t vorbis_fpu_control; diff --git a/modules/juce_core/juce_core.cpp b/modules/juce_core/juce_core.cpp index 1c58ba7732..a6a2ef7665 100644 --- a/modules/juce_core/juce_core.cpp +++ b/modules/juce_core/juce_core.cpp @@ -48,7 +48,11 @@ #if JUCE_WINDOWS #include - #if ! JUCE_MINGW + #if JUCE_MINGW + #include + #include + #include + #else #pragma warning (push) #pragma warning (disable: 4091) #include @@ -59,12 +63,6 @@ #endif #endif - #if JUCE_MINGW - #include - #include - #include - #endif - #else #if JUCE_LINUX || JUCE_ANDROID #include diff --git a/modules/juce_core/juce_core.h b/modules/juce_core/juce_core.h index 3a88ff18ab..ce9a65694c 100644 --- a/modules/juce_core/juce_core.h +++ b/modules/juce_core/juce_core.h @@ -107,7 +107,7 @@ //============================================================================== /** Config: JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES - In a Visual C++ build, this can be used to stop the required system libs being + In a Windows build, this can be used to stop the required system libs being automatically added to the link stage. */ #ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES diff --git a/modules/juce_core/native/juce_BasicNativeHeaders.h b/modules/juce_core/native/juce_BasicNativeHeaders.h index f9281e1f9b..9ec827f2fa 100644 --- a/modules/juce_core/native/juce_BasicNativeHeaders.h +++ b/modules/juce_core/native/juce_BasicNativeHeaders.h @@ -176,7 +176,7 @@ #pragma warning (4: 4511 4512 4100) #endif - #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES + #if ! JUCE_MINGW && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES #pragma comment (lib, "kernel32.lib") #pragma comment (lib, "user32.lib") #pragma comment (lib, "wininet.lib") diff --git a/modules/juce_core/native/juce_win32_SystemStats.cpp b/modules/juce_core/native/juce_win32_SystemStats.cpp index 5c74c207e6..bbdd2586dc 100644 --- a/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -23,7 +23,7 @@ namespace juce { -#if ! JUCE_MINGW +#if JUCE_MSVC #pragma intrinsic (__cpuid) #pragma intrinsic (__rdtsc) #endif @@ -41,7 +41,7 @@ void Logger::outputDebugString (const String& text) //============================================================================== -#if JUCE_MINGW +#if JUCE_MINGW || JUCE_CLANG static void callCPUID (int result[4], uint32 type) { uint32 la = result[0], lb = result[1], lc = result[2], ld = result[3]; diff --git a/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp b/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp index 6e8facbcb0..cc2b4f8a31 100644 --- a/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp +++ b/modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp @@ -48,13 +48,13 @@ namespace DirectWriteTypeLayout return ComBaseClassHelper::QueryInterface (refId, result); } - JUCE_COMRESULT IsPixelSnappingDisabled (void* /*clientDrawingContext*/, BOOL* isDisabled) override + JUCE_COMRESULT IsPixelSnappingDisabled (void* /*clientDrawingContext*/, BOOL* isDisabled) noexcept override { *isDisabled = FALSE; return S_OK; } - JUCE_COMRESULT GetCurrentTransform (void*, DWRITE_MATRIX* matrix) override + JUCE_COMRESULT GetCurrentTransform (void*, DWRITE_MATRIX* matrix) noexcept override { matrix->m11 = 1.0f; matrix->m12 = 0.0f; matrix->m21 = 0.0f; matrix->m22 = 1.0f; @@ -62,30 +62,30 @@ namespace DirectWriteTypeLayout return S_OK; } - JUCE_COMRESULT GetPixelsPerDip (void*, FLOAT* pixelsPerDip) override + JUCE_COMRESULT GetPixelsPerDip (void*, FLOAT* pixelsPerDip) noexcept override { *pixelsPerDip = 1.0f; return S_OK; } - JUCE_COMRESULT DrawUnderline (void*, FLOAT, FLOAT, DWRITE_UNDERLINE const*, IUnknown*) override + JUCE_COMRESULT DrawUnderline (void*, FLOAT, FLOAT, DWRITE_UNDERLINE const*, IUnknown*) noexcept override { return E_NOTIMPL; } - JUCE_COMRESULT DrawStrikethrough (void*, FLOAT, FLOAT, DWRITE_STRIKETHROUGH const*, IUnknown*) override + JUCE_COMRESULT DrawStrikethrough (void*, FLOAT, FLOAT, DWRITE_STRIKETHROUGH const*, IUnknown*) noexcept override { return E_NOTIMPL; } - JUCE_COMRESULT DrawInlineObject (void*, FLOAT, FLOAT, IDWriteInlineObject*, BOOL, BOOL, IUnknown*) override + JUCE_COMRESULT DrawInlineObject (void*, FLOAT, FLOAT, IDWriteInlineObject*, BOOL, BOOL, IUnknown*) noexcept override { return E_NOTIMPL; } JUCE_COMRESULT DrawGlyphRun (void* clientDrawingContext, FLOAT baselineOriginX, FLOAT baselineOriginY, DWRITE_MEASURING_MODE, DWRITE_GLYPH_RUN const* glyphRun, DWRITE_GLYPH_RUN_DESCRIPTION const* runDescription, - IUnknown* clientDrawingEffect) override + IUnknown* clientDrawingEffect) noexcept override { auto layout = static_cast (clientDrawingContext); @@ -207,7 +207,7 @@ namespace DirectWriteTypeLayout DWRITE_FONT_METRICS dwFontMetrics; dwFontFace->GetMetrics (&dwFontMetrics); - const float totalHeight = (float) (std::abs (dwFontMetrics.ascent) + std::abs (dwFontMetrics.descent)); + const float totalHeight = (float) (dwFontMetrics.ascent + dwFontMetrics.descent); return dwFontMetrics.designUnitsPerEm / totalHeight; } diff --git a/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp b/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp index b4d53b44b3..7ffea03a56 100644 --- a/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp +++ b/modules/juce_graphics/native/juce_win32_DirectWriteTypeface.cpp @@ -285,7 +285,7 @@ private: { PathGeometrySink() : ComBaseClassHelper (0) {} - void __stdcall AddBeziers (const D2D1_BEZIER_SEGMENT* beziers, UINT beziersCount) override + void __stdcall AddBeziers (const D2D1_BEZIER_SEGMENT* beziers, UINT beziersCount) noexcept override { for (UINT i = 0; i < beziersCount; ++i) path.cubicTo (convertPoint (beziers[i].point1), @@ -293,30 +293,30 @@ private: convertPoint (beziers[i].point3)); } - void __stdcall AddLines (const D2D1_POINT_2F* points, UINT pointsCount) override + void __stdcall AddLines (const D2D1_POINT_2F* points, UINT pointsCount) noexcept override { for (UINT i = 0; i < pointsCount; ++i) path.lineTo (convertPoint (points[i])); } - void __stdcall BeginFigure (D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN) override + void __stdcall BeginFigure (D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN) noexcept override { path.startNewSubPath (convertPoint (startPoint)); } - void __stdcall EndFigure (D2D1_FIGURE_END figureEnd) override + void __stdcall EndFigure (D2D1_FIGURE_END figureEnd) noexcept override { if (figureEnd == D2D1_FIGURE_END_CLOSED) path.closeSubPath(); } - void __stdcall SetFillMode (D2D1_FILL_MODE fillMode) override + void __stdcall SetFillMode (D2D1_FILL_MODE fillMode) noexcept override { path.setUsingNonZeroWinding (fillMode == D2D1_FILL_MODE_WINDING); } - void __stdcall SetSegmentFlags (D2D1_PATH_SEGMENT) override {} - JUCE_COMRESULT Close() override { return S_OK; } + void __stdcall SetSegmentFlags (D2D1_PATH_SEGMENT) noexcept override {} + JUCE_COMRESULT Close() noexcept override { return S_OK; } Path path; diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index 478dd37f7a..9143cec5ae 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -71,25 +71,21 @@ #include #endif - #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES + #if JUCE_MINGW + #include + #elif ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES #pragma comment(lib, "vfw32.lib") #pragma comment(lib, "imm32.lib") - #endif - #if JUCE_OPENGL - #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES + #if JUCE_OPENGL #pragma comment(lib, "OpenGL32.Lib") #pragma comment(lib, "GlU32.Lib") #endif - #endif - #if JUCE_DIRECT2D && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES - #pragma comment (lib, "Dwrite.lib") - #pragma comment (lib, "D2d1.lib") - #endif - - #if JUCE_MINGW - #include + #if JUCE_DIRECT2D + #pragma comment (lib, "Dwrite.lib") + #pragma comment (lib, "D2d1.lib") + #endif #endif //============================================================================== diff --git a/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp b/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp index 46d0778978..1b0ff1e621 100644 --- a/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp +++ b/modules/juce_gui_basics/native/juce_win32_DragAndDrop.cpp @@ -125,8 +125,8 @@ namespace DragAndDropHelpers class JuceDataObject : public ComBaseClassHelper { public: - JuceDataObject (JuceDropSource* s, const FORMATETC* f, const STGMEDIUM* m) - : dropSource (s), format (f), medium (m) + JuceDataObject (const FORMATETC* f, const STGMEDIUM* m) + : format (f), medium (m) { } @@ -203,7 +203,6 @@ namespace DragAndDropHelpers JUCE_COMRESULT EnumDAdvise (IEnumSTATDATA**) { return OLE_E_ADVISENOTSUPPORTED; } private: - JuceDropSource* const dropSource; const FORMATETC* const format; const STGMEDIUM* const medium; @@ -255,7 +254,7 @@ namespace DragAndDropHelpers OleInitialize (0); auto source = new JuceDropSource(); - auto data = new JuceDataObject (source, &format, &medium); + auto data = new JuceDataObject (&format, &medium); DWORD effect; DoDragDrop (data, source, whatToDo, &effect); diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index b9c217e8a5..80f1556429 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -2241,7 +2241,7 @@ private: } } - void setIcon (const Image& newIcon) + void setIcon (const Image& newIcon) override { if (auto hicon = IconConverters::createHICONFromImage (newIcon, TRUE, 0, 0)) { diff --git a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp index afdc0b634a..8e01c69646 100644 --- a/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp +++ b/modules/juce_gui_extra/native/juce_win32_WebBrowserComponent.cpp @@ -153,12 +153,12 @@ private: { EventHandler (WebBrowserComponent& w) : ComponentMovementWatcher (&w), owner (w) {} - JUCE_COMRESULT GetTypeInfoCount (UINT*) { return E_NOTIMPL; } - JUCE_COMRESULT GetTypeInfo (UINT, LCID, ITypeInfo**) { return E_NOTIMPL; } - JUCE_COMRESULT GetIDsOfNames (REFIID, LPOLESTR*, UINT, LCID, DISPID*) { return E_NOTIMPL; } + JUCE_COMRESULT GetTypeInfoCount (UINT*) override { return E_NOTIMPL; } + JUCE_COMRESULT GetTypeInfo (UINT, LCID, ITypeInfo**) override { return E_NOTIMPL; } + JUCE_COMRESULT GetIDsOfNames (REFIID, LPOLESTR*, UINT, LCID, DISPID*) override { return E_NOTIMPL; } JUCE_COMRESULT Invoke (DISPID dispIdMember, REFIID /*riid*/, LCID /*lcid*/, WORD /*wFlags*/, DISPPARAMS* pDispParams, - VARIANT* /*pVarResult*/, EXCEPINFO* /*pExcepInfo*/, UINT* /*puArgErr*/) + VARIANT* /*pVarResult*/, EXCEPINFO* /*pExcepInfo*/, UINT* /*puArgErr*/) override { if (dispIdMember == DISPID_BEFORENAVIGATE2) { diff --git a/modules/juce_opengl/juce_opengl.cpp b/modules/juce_opengl/juce_opengl.cpp index e3e96e8cda..b9ad3502d0 100644 --- a/modules/juce_opengl/juce_opengl.cpp +++ b/modules/juce_opengl/juce_opengl.cpp @@ -48,7 +48,7 @@ #elif JUCE_WINDOWS #include - #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES + #if ! JUCE_MINGW && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES #pragma comment(lib, "OpenGL32.Lib") #endif diff --git a/modules/juce_video/juce_video.cpp b/modules/juce_video/juce_video.cpp index bec17ed285..c3f89fc16f 100644 --- a/modules/juce_video/juce_video.cpp +++ b/modules/juce_video/juce_video.cpp @@ -45,24 +45,24 @@ #import //============================================================================== -#elif JUCE_MSVC +#elif JUCE_WINDOWS && ! JUCE_MINGW /* If you're using the camera classes, you'll need access to a few DirectShow headers. These files are provided in the normal Windows SDK. */ #include #include #include - #if JUCE_USE_CAMERA && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES - #pragma comment (lib, "Strmiids.lib") - #pragma comment (lib, "wmvcore.lib") - #endif - - #if JUCE_MEDIAFOUNDATION && JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES - #pragma comment (lib, "mfuuid.lib") - #endif - - #if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES + #if ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES #pragma comment (lib, "strmiids.lib") + + #if JUCE_USE_CAMERA + #pragma comment (lib, "Strmiids.lib") + #pragma comment (lib, "wmvcore.lib") + #endif + + #if JUCE_MEDIAFOUNDATION + #pragma comment (lib, "mfuuid.lib") + #endif #endif #endif