From 4628e5cded8b1b4f064b75f23436bc6fc66ce043 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Apr 2019 11:56:33 +0200 Subject: Remove handling of missing very old compiler feature check Removes handling of missing Q_COMPILER_NULLPTR, Q_COMPILER_AUTODECL, Q_COMPILER_LAMBDA, Q_COMPILER_VARIADIC_MACROS and Q_COMPILER_AUTO_FUNCTION. We haven't supported any compilers without these for a long time. Change-Id: I3df88206516a25763e2c28b083733780f35a8764 Reviewed-by: Thiago Macieira --- src/corelib/tools/qarraydata.h | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/corelib/tools/qarraydata.h') diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index f78b9be2db..7e3f8c9dbd 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -306,8 +306,6 @@ struct QArrayDataPointerRef // accomplished by hiding a static const instance of QStaticArrayData, which is // POD. -#if defined(Q_COMPILER_VARIADIC_MACROS) -#if defined(Q_COMPILER_LAMBDA) // Hide array inside a lambda #define Q_ARRAY_LITERAL(Type, ...) \ ([]() -> QArrayDataPointerRef { \ @@ -324,10 +322,7 @@ struct QArrayDataPointerRef return StaticWrapper::get(); \ }()) \ /**/ -#endif -#endif // defined(Q_COMPILER_VARIADIC_MACROS) -#if defined(Q_ARRAY_LITERAL) #define Q_ARRAY_LITERAL_IMPL(Type, ...) \ union { Type type_must_be_POD; } dummy; Q_UNUSED(dummy) \ \ @@ -342,31 +337,6 @@ struct QArrayDataPointerRef { static_cast *>( \ const_cast(&literal.header)) }; \ /**/ -#else -// As a fallback, memory is allocated and data copied to the heap. - -// The fallback macro does NOT use variadic macros and does NOT support -// variable number of arguments. It is suitable for char arrays. - -namespace QtPrivate { - template - inline QArrayDataPointerRef qMakeArrayLiteral(const T (&array)[N]) - { - union { T type_must_be_POD; } dummy; Q_UNUSED(dummy) - - QArrayDataPointerRef result = { QTypedArrayData::allocate(N) }; - Q_CHECK_PTR(result.ptr); - - ::memcpy(result.ptr->data(), array, N * sizeof(T)); - result.ptr->size = N; - - return result; - } -} - -#define Q_ARRAY_LITERAL(Type, Array) \ - QT_PREPEND_NAMESPACE(QtPrivate::qMakeArrayLiteral)( Array ) -#endif // !defined(Q_ARRAY_LITERAL) namespace QtPrivate { struct Q_CORE_EXPORT QContainerImplHelper -- cgit v1.2.3