From c527c26a6e1128f5f0e548256a953249b28ccc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 18 Dec 2019 20:00:59 +0100 Subject: [PATCH] GL: fix clang-cl warning about C-incompatible function signatures. --- src/Magnum/GL/Context.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 897c6b0d1..b4015a884 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -526,10 +526,19 @@ 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) +/* Clang-CL complains that the function has a return type incompatible with C. + I don't care, I only need an unmangled name to look up later at runtime. */ +#ifdef CORRADE_TARGET_CLANG_CL +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wreturn-type-c-linkage" +#endif extern "C" CORRADE_VISIBILITY_EXPORT Context*& magnumGLUniqueCurrentContext(); extern "C" CORRADE_VISIBILITY_EXPORT Context*& magnumGLUniqueCurrentContext() { return currentContext; } +#ifdef CORRADE_TARGET_CLANG_CL +#pragma clang diagnostic pop +#endif namespace {