From 0f2079efb82bc81c8e766dbb4890cb6e5c530a38 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 23 Aug 2022 16:23:42 +0200 Subject: Extract header qdarwinhelpers.h from qglobal.h Task-number: QTBUG-99313 Change-Id: Ia25270d381de99c5fcbb205d750e7bf86d4438dc Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/corelib/global/qdarwinhelpers.h | 37 ++++++++++++++++++++++++++++++++++ src/corelib/global/qdarwinhelpers.qdoc | 34 +++++++++++++++++++++++++++++++ src/corelib/global/qglobal.cpp | 32 ----------------------------- src/corelib/global/qglobal.h | 25 +---------------------- 4 files changed, 72 insertions(+), 56 deletions(-) create mode 100644 src/corelib/global/qdarwinhelpers.h create mode 100644 src/corelib/global/qdarwinhelpers.qdoc (limited to 'src/corelib/global') diff --git a/src/corelib/global/qdarwinhelpers.h b/src/corelib/global/qdarwinhelpers.h new file mode 100644 index 0000000000..2ffc740d58 --- /dev/null +++ b/src/corelib/global/qdarwinhelpers.h @@ -0,0 +1,37 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QTDARWINHELPERS_H +#define QTDARWINHELPERS_H + +#if 0 +#pragma qt_class(QtDarwinHelpers) +#pragma qt_sync_stop_processing +#endif + +/* + Utility macros and inline functions +*/ + +#ifndef Q_FORWARD_DECLARE_OBJC_CLASS +# ifdef __OBJC__ +# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname +# else +# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) class classname +# endif +#endif +#ifndef Q_FORWARD_DECLARE_CF_TYPE +# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref +#endif +#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE +# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref +#endif +#ifndef Q_FORWARD_DECLARE_CG_TYPE +#define Q_FORWARD_DECLARE_CG_TYPE(type) typedef const struct type *type ## Ref; +#endif +#ifndef Q_FORWARD_DECLARE_MUTABLE_CG_TYPE +#define Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) typedef struct type *type ## Ref; +#endif + + +#endif // QTDARWINHELPERS_H diff --git a/src/corelib/global/qdarwinhelpers.qdoc b/src/corelib/global/qdarwinhelpers.qdoc new file mode 100644 index 0000000000..a827526634 --- /dev/null +++ b/src/corelib/global/qdarwinhelpers.qdoc @@ -0,0 +1,34 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \macro Q_FORWARD_DECLARE_OBJC_CLASS(classname) + \since 5.2 + \relates + + Forward-declares an Objective-C \a classname in a manner such that it can be + compiled as either Objective-C or C++. + + This is primarily intended for use in header files that may be included by + both Objective-C and C++ source files. +*/ + +/*! + \macro Q_FORWARD_DECLARE_CF_TYPE(type) + \since 5.2 + \relates + + Forward-declares a Core Foundation \a type. This includes the actual + type and the ref type. For example, Q_FORWARD_DECLARE_CF_TYPE(CFString) + declares __CFString and CFStringRef. +*/ + +/*! + \macro Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) + \since 5.2 + \relates + + Forward-declares a mutable Core Foundation \a type. This includes the actual + type and the ref type. For example, Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(CFMutableString) + declares __CFMutableString and CFMutableStringRef. +*/ diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 57892b4109..0e5b2d5b80 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -3560,38 +3560,6 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) \sa Q_DECL_OVERRIDE */ -/*! - \macro Q_FORWARD_DECLARE_OBJC_CLASS(classname) - \since 5.2 - \relates - - Forward-declares an Objective-C \a classname in a manner such that it can be - compiled as either Objective-C or C++. - - This is primarily intended for use in header files that may be included by - both Objective-C and C++ source files. -*/ - -/*! - \macro Q_FORWARD_DECLARE_CF_TYPE(type) - \since 5.2 - \relates - - Forward-declares a Core Foundation \a type. This includes the actual - type and the ref type. For example, Q_FORWARD_DECLARE_CF_TYPE(CFString) - declares __CFString and CFStringRef. -*/ - -/*! - \macro Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) - \since 5.2 - \relates - - Forward-declares a mutable Core Foundation \a type. This includes the actual - type and the ref type. For example, Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(CFMutableString) - declares __CFMutableString and CFMutableStringRef. -*/ - namespace QtPrivate { Q_LOGGING_CATEGORY(lcNativeInterface, "qt.nativeinterface") } diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 65bb2b35a4..8f1cd4c684 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -63,30 +63,6 @@ Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT; #if defined(__cplusplus) -/* - Utility macros and inline functions -*/ - -#ifndef Q_FORWARD_DECLARE_OBJC_CLASS -# ifdef __OBJC__ -# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) @class classname -# else -# define Q_FORWARD_DECLARE_OBJC_CLASS(classname) class classname -# endif -#endif -#ifndef Q_FORWARD_DECLARE_CF_TYPE -# define Q_FORWARD_DECLARE_CF_TYPE(type) typedef const struct __ ## type * type ## Ref -#endif -#ifndef Q_FORWARD_DECLARE_MUTABLE_CF_TYPE -# define Q_FORWARD_DECLARE_MUTABLE_CF_TYPE(type) typedef struct __ ## type * type ## Ref -#endif -#ifndef Q_FORWARD_DECLARE_CG_TYPE -#define Q_FORWARD_DECLARE_CG_TYPE(type) typedef const struct type *type ## Ref; -#endif -#ifndef Q_FORWARD_DECLARE_MUTABLE_CG_TYPE -#define Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(type) typedef struct type *type ## Ref; -#endif - #ifdef Q_OS_DARWIN // Implemented in qcore_mac_objc.mm @@ -141,6 +117,7 @@ QT_END_NAMESPACE #include #include +#include #include #include #include -- cgit v1.2.3