From b5d964e62b7e9c391719e2502f630de8a9ee0070 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 20 Jul 2015 13:14:11 -0700 Subject: [PATCH] Sqlite: Stop using QtCore private macros in Qt Creator Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER is entirely private and may change at any time. More importantly, this macro is not necessary at all. QByteArrayLiteral solves the problem neatly. Change-Id: Ib306f8f647014b399b87ffff13f2c0f38c459ab1 Reviewed-by: Adam Majer Reviewed-by: Orgad Shaneh Reviewed-by: Marco Bubke --- src/libs/sqlite/utf8string.h | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/libs/sqlite/utf8string.h b/src/libs/sqlite/utf8string.h index 4a7c8512ccb..70531db218f 100644 --- a/src/libs/sqlite/utf8string.h +++ b/src/libs/sqlite/utf8string.h @@ -115,27 +115,7 @@ SQLITE_EXPORT QDataStream &operator>>(QDataStream &datastream, Utf8String &text) SQLITE_EXPORT QDebug operator<<(QDebug debug, const Utf8String &text); SQLITE_EXPORT void PrintTo(const Utf8String &text, ::std::ostream* os); -#if defined(Q_COMPILER_LAMBDA) - -# define Utf8StringLiteral(str) \ - ([]() -> Utf8String { \ - enum { Size = sizeof(str) - 1 }; \ - static const QStaticByteArrayData qbytearray_literal = { \ - Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER(Size), \ - str }; \ - QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; \ - const QByteArray byteArray(holder); \ - return Utf8String::fromByteArray(byteArray); \ - }()) \ - /**/ - -#endif - -#ifndef Utf8StringLiteral -// no lambdas, not GCC, just return a temporary QByteArray - -# define Utf8StringLiteral(str) Utf8String(str, sizeof(str) - 1) -#endif +#define Utf8StringLiteral(str) Utf8String::fromByteArray(QByteArrayLiteral(str)) Q_DECLARE_METATYPE(Utf8String)