From 2ad63a097596c7f5fc3f165f24bfbbd7af7c5ef3 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 13 Feb 2023 20:34:11 +0200 Subject: [PATCH] qcompilerdetection: all supported compilers have visibility attributes Remove a redundant QT_VISIBILITY_AVAILABLE check. Pointed out by Thiago in review. Note that this is going to help with breaking include cycles between qglobal.h and qcompilerdetection.h (otherwise we'd have to include qtconfiginclude.h in qcompilerdetection.h as the former includes qconfig.h which defines QT_VISIBILITY_AVAILABLE; without QT_VISIBILITY_AVAILABLE defined, Q_DECL_EXPORT/IMPORT expands to nothing on Linux and co., and tools linking to qtcore (with bootstrap) can't find exported methods. Change-Id: Ib1244d43e606a6c80e122adea631305f6d8c51d3 Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 768d3ed6ce4..cb91b82fa70 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -175,7 +175,7 @@ # ifdef Q_OS_WIN # define Q_DECL_EXPORT __declspec(dllexport) # define Q_DECL_IMPORT __declspec(dllimport) -# elif defined(QT_VISIBILITY_AVAILABLE) +# else # define Q_DECL_EXPORT_OVERRIDABLE __attribute__((visibility("default"), weak)) # ifdef QT_USE_PROTECTED_VISIBILITY # define Q_DECL_EXPORT __attribute__((visibility("protected")))