qt5base-lts/qmake/generators
Giuseppe D'Angelo f66c1db16c Introduce Q_NAMESPACE_EXPORT
A recurring problem with the Q_NAMESPACE macro is that it declares
an object (staticMetaObject) in the surrounding namespace. That
object lacks any export/import qualification to make it usable
with shared libraries.

Introduce therefore another macro to work around this issue, allowing
the user to prefix the object with an exporting macro, f.i. like this:

Q_NAMESPACE_EXPORT(Q_CORE_EXPORT)

The old macro can simply then be rewritten in terms of this new one,
supplying an empty export macro.

Note that NOT passing an argument to a macro expecting one is well
defined behavior in C99 -- the macro will expand an empty token.
Of course, MSVC doesn't like this and emits warnings. As a
workaround, use a variadic macro.

[ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It
can be used just like Q_NAMESPACE to add meta-object information
to a namespace; however it also supports exporting of such
information from shared libraries.

[ChangeLog][Potentially Source-Incompatible Changes] Prefixing
Q_NAMESPACE with an export macro may no longer work. Use the new
Q_NAMESPACE_EXPORT macro for that use case.

Fixes: QTBUG-68014
Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-28 06:47:29 +02:00
..
mac Merge remote-tracking branch 'origin/5.13' into dev 2019-06-14 13:45:18 +02:00
unix Merge remote-tracking branch 'origin/5.13' into dev 2019-06-14 13:45:18 +02:00
win32 Merge remote-tracking branch 'origin/5.13' into dev 2019-06-27 14:38:03 +02:00
makefile.cpp Merge remote-tracking branch 'origin/5.13' into dev 2019-06-14 13:45:18 +02:00
makefile.h De-duplicate code for calling extra compiler depend_command 2019-05-29 11:06:10 +02:00
makefiledeps.cpp Introduce Q_NAMESPACE_EXPORT 2019-06-28 06:47:29 +02:00
makefiledeps.h qmake: replace a uint:1 with a bool 2016-08-15 22:16:09 +00:00
metamakefile.cpp QRegExp include cleanup 2019-04-19 21:21:17 +00:00
metamakefile.h qmake: Apply modernize-use-nullptr 2018-08-08 17:30:32 +00:00
projectgenerator.cpp Clean up class definitions of makefile generators 2019-05-16 11:36:22 +00:00
projectgenerator.h Merge remote-tracking branch 'origin/5.13' into dev 2019-06-14 13:45:18 +02:00
xmloutput.cpp Prefix textstream operators with Qt:: 2019-05-02 11:52:02 +00:00
xmloutput.h Updated license headers 2016-01-21 18:55:18 +00:00