diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/corelib/global/qdarwinhelpers.h | 37 | ||||
-rw-r--r-- | src/corelib/global/qdarwinhelpers.qdoc | 34 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 32 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 25 |
5 files changed, 73 insertions, 56 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 0f0c576a64..b287f29f92 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -53,6 +53,7 @@ qt_internal_add_module(Core global/qcompilerdetection.h global/qconstructormacros.h global/qcontainerinfo.h + global/qdarwinhelpers.h global/qendian.cpp global/qendian.h global/qendian_p.h global/qenvironmentvariables.cpp global/qenvironmentvariables.h global/qexceptionhandling.cpp global/qexceptionhandling.h 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 <QtDarwinHelpers> + + 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 <QtDarwinHelpers> + + 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 <QtDarwinHelpers> + + 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 <QtGlobal> - - 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 <QtGlobal> - - 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 <QtGlobal> - - 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 <QtCore/qatomic.h> #include <QtCore/qconstructormacros.h> +#include <QtCore/qdarwinhelpers.h> #include <QtCore/qenvironmentvariables.h> #include <QtCore/qexceptionhandling.h> #include <QtCore/qforeach.h> |