diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2021-10-18 18:12:39 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2021-10-25 14:57:18 +0200 |
commit | 2a72f0f15d9c433d8d03873637e84fe2e10735b7 (patch) | |
tree | 08aab5b27314c71f303c598687b3faf28ea31904 /src/corelib | |
parent | 623e396e881f383950b78518a193aff602d8568e (diff) |
Fix compilation with QT_NAMESPACE and tracing on Linux
The tracegen tool was not taking into account that Qt could be build
with a custom namespace. As a result, the combination of namespace
build and tracing enabled was not working, because tracegen generated
classes without the namespace.
This patch fixes it.
We cannot add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE because of the
tricky logic that recursively includes the generated header file
multiple times, also including the code like
static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)[] = {
(hash)include TRACEPOINT_INCLUDE
NULL, /* Dummy, C99 forbids 0-len array. */
};
where TRACEPOINT_INCLUDE is the path to the generated header.
This patch is using QT_USE_NAMESPACE, wrapped into some #ifdefs.
This should be safe, considering that the generated trace headers
are only used as private API.
The windows tracing support seems to be broken even in a
non-namespace build, so it's not handled in this patch.
Task-number: QTBUG-97246
Pick-to: 6.2
Change-Id: I12db76e199a3aa3abde641fbf99a6e1a3d7de203
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'src/corelib')
0 files changed, 0 insertions, 0 deletions