diff options
author | Michael Pyne <mpyne@kde.org> | 2018-07-04 11:36:14 -0400 |
---|---|---|
committer | Michael Pyne <mpyne@kde.org> | 2018-07-04 23:36:17 +0000 |
commit | 4b10298de54a7cacb5f25601f8e3ae5d233806d3 (patch) | |
tree | 738a7e3a9e864f5e509d67782dc3609ebeda075a /src/corelib/serialization/qcborcommon.h | |
parent | 21ea8c05ffa719cd3342b4a1c02620b556f4ec7b (diff) |
CBOR: Avoid conflicts with X11 #defines in our enums
Since the .cpp files in the implementation don't actually include the
offending X11 headers they don't need the fix. This just adjusts the
headers themselves to unbreak the namespace for just long enough to
declare the right enums.
Change-Id: If33757aa2289f8fe7b81836f9c08b0ad4592bc32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qcborcommon.h')
-rw-r--r-- | src/corelib/serialization/qcborcommon.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/serialization/qcborcommon.h b/src/corelib/serialization/qcborcommon.h index 2c6d44657d..9661cd70bb 100644 --- a/src/corelib/serialization/qcborcommon.h +++ b/src/corelib/serialization/qcborcommon.h @@ -48,6 +48,13 @@ #pragma qt_class(QtCborCommon) #endif +/* X11 headers use these values too, but as defines */ +#if defined(False) && defined(True) +# define QT_X11_DEFINES_FOUND 1 +# undef True +# undef False +#endif + QT_BEGIN_NAMESPACE enum class QCborSimpleType : quint8 { @@ -130,4 +137,11 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QCborTag) +// To avoid changing namespace we need to reinstate defines, even though our .cpp +// will then have to remove them again. +#if defined(QT_X11_DEFINES_FOUND) +# define True 1 +# define False 0 +#endif + #endif // QCBORSTREAM_H |