qversiontagging.h: remove the attempt to use the "retain" attribute

GCC 11 knows about it, meaning __has_attribute(retain) = 1 regardless of
whether GCC can emit code for it. Clang has a similar limitation.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587

Fixes: QTBUG-101753
Change-Id: Ic30914a4448d4bc28974fffd16dce9a78cdefe5b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Thiago Macieira 2022-03-16 09:34:29 -07:00
parent 5c85b0c7a4
commit 32e24e011e

View File

@ -137,11 +137,7 @@ struct QVersionTag
# ifdef Q_OS_DARWIN
# define QT_VERSION_TAG_SECTION __attribute__((section("__DATA,.qtversion")))
# endif
# if __has_attribute(retain)
# define QT_VERSION_TAG_ATTRIBUTE __attribute__((visibility("hidden"), retain, used))
# else
# define QT_VERSION_TAG_ATTRIBUTE __attribute__((visibility("hidden"), used))
# endif
# define QT_VERSION_TAG_ATTRIBUTE __attribute__((visibility("hidden"), used))
# define QT_VERSION_TAG2(sym, imp) \
extern "C" Q_DECL_IMPORT const char sym; \
QT_VERSION_TAG_ATTRIBUTE QT_VERSION_TAG_SECTION constexpr inline QtPrivate::QVersionTag sym ## _use(&sym)