summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-08-23 16:23:42 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-08-30 20:56:46 +0200
commit0f2079efb82bc81c8e766dbb4890cb6e5c530a38 (patch)
tree8b998d4ff32a568969c762c944cdd409e823f3b6 /src
parent9ecc119276e3741b2b71f2513510f583a3f92635 (diff)
Extract header qdarwinhelpers.h from qglobal.h
Task-number: QTBUG-99313 Change-Id: Ia25270d381de99c5fcbb205d750e7bf86d4438dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/CMakeLists.txt1
-rw-r--r--src/corelib/global/qdarwinhelpers.h37
-rw-r--r--src/corelib/global/qdarwinhelpers.qdoc34
-rw-r--r--src/corelib/global/qglobal.cpp32
-rw-r--r--src/corelib/global/qglobal.h25
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>