summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-26 10:56:54 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-27 00:16:26 +0200
commitaa0a53fc19be10b8b1d191415bda82af259a8b23 (patch)
tree1fd2a8587a056427368ce183578a2f667cbe8bd3 /src
parentc164b75c175394000b17486c853be95e9e6d5752 (diff)
Don't declare type 'id' in the global namespace in a public header
It's not necessary, and it breaks the qttools build (where we have a global variable named 'id'), and thus will most certainly build a lot of existing user code. Amends e47c22480fe84c100019cd92d0296f0dd2a7f3f1. Change-Id: I97a91c2cb23fdae65143cf14c81570cf88d529d5 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdebug.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 847fc676ad..306be90102 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -530,7 +530,7 @@ inline QDebug operator<<(QDebug debug, QKeyCombination combination)
QT_END_NAMESPACE
Q_FORWARD_DECLARE_CF_TYPE(CFString);
-typedef struct objc_object *id;
+struct objc_object;
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject);
QT_FOR_EACH_CORE_FOUNDATION_TYPE(QT_FORWARD_DECLARE_CF_TYPE)
QT_FOR_EACH_MUTABLE_CORE_FOUNDATION_TYPE(QT_FORWARD_DECLARE_MUTABLE_CF_TYPE)
@@ -555,7 +555,10 @@ QT_BEGIN_NAMESPACE
}
// Defined in qcore_mac_objc.mm
-Q_CORE_EXPORT QDebug operator<<(QDebug, id obj);
+#if defined(__OBJC__)
+Q_CORE_EXPORT QDebug operator<<(QDebug, id);
+#endif
+Q_CORE_EXPORT QDebug operator<<(QDebug, objc_object *);
Q_CORE_EXPORT QDebug operator<<(QDebug, const NSObject *);
Q_CORE_EXPORT QDebug operator<<(QDebug, CFStringRef);