diff --git a/src/Magnum/Audio/Context.cpp b/src/Magnum/Audio/Context.cpp index 9e531b3ef..8f9558350 100644 --- a/src/Magnum/Audio/Context.cpp +++ b/src/Magnum/Audio/Context.cpp @@ -142,8 +142,12 @@ CORRADE_VISIBILITY_EXPORT Context* currentContext = nullptr; #else /* On Windows the symbol is exported unmangled and then fetched via - GetProcAddress() to emulate weak linking. */ -extern "C" CORRADE_VISIBILITY_EXPORT Context* magnumAudioUniqueCurrentContext = nullptr; + GetProcAddress() to emulate weak linking. Using an extern "C" block instead + of just a function annotation because otherwise MinGW prints a warning: + '...' initialized and declared 'extern' (uh?) */ +extern "C" { + CORRADE_VISIBILITY_EXPORT Context* magnumAudioUniqueCurrentContext = nullptr; +} #endif #if !defined(MAGNUM_BUILD_STATIC) || defined(CORRADE_TARGET_WINDOWS) diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index c89b3eaa5..58209a75f 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -513,6 +513,7 @@ Context* currentContext = nullptr; called from. To avoid #ifdef hell in code below, the currentContext is redefined to return a value from this uniqueness-ensuring function. */ #if defined(CORRADE_TARGET_WINDOWS) && defined(MAGNUM_BUILD_STATIC) && !defined(CORRADE_TARGET_WINDOWS_RT) +extern "C" CORRADE_VISIBILITY_EXPORT Context*& magnumGLUniqueCurrentContext(); extern "C" CORRADE_VISIBILITY_EXPORT Context*& magnumGLUniqueCurrentContext() { return currentContext; }