From 597df79c27a2573d540e231bb7b88baf40e5e58e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 2 May 2016 18:45:59 +0200 Subject: darwin: Simplify conversion function declarations in headers We don't need to include Q_QDOC in the forward-declarations of the native types, and Q_FORWARD_DECLARE_OBJC_CLASS works in non-Objective-C mode as well, which means we can declare the Objective-C versions of the functions without guards. Change-Id: I32089c496b4f7ce47f0388ba3f65e0b091d1e9ee Reviewed-by: Martin Smith Reviewed-by: Jake Petroules --- src/corelib/io/qurl.h | 6 +----- src/corelib/plugin/quuid.h | 6 +----- src/corelib/tools/qbytearray.h | 6 +----- src/corelib/tools/qdatetime.h | 6 +----- src/corelib/tools/qstring.h | 6 +----- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index a6dc66d457..c565ac408e 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -48,11 +48,9 @@ #include #include -#if defined(Q_OS_MAC) || defined(Q_QDOC) +#if defined(Q_OS_MAC) Q_FORWARD_DECLARE_CF_TYPE(CFURL); -# if defined(__OBJC__) || defined(Q_QDOC) Q_FORWARD_DECLARE_OBJC_CLASS(NSURL); -# endif #endif QT_BEGIN_NAMESPACE @@ -280,10 +278,8 @@ public: #if defined(Q_OS_MAC) || defined(Q_QDOC) static QUrl fromCFURL(CFURLRef url); CFURLRef toCFURL() const Q_DECL_CF_RETURNS_RETAINED; -# if defined(__OBJC__) || defined(Q_QDOC) static QUrl fromNSURL(const NSURL *url); NSURL *toNSURL() const Q_DECL_NS_RETURNS_AUTORELEASED; -# endif #endif #if QT_DEPRECATED_SINCE(5,0) diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h index 409eec1989..fef0beba11 100644 --- a/src/corelib/plugin/quuid.h +++ b/src/corelib/plugin/quuid.h @@ -55,11 +55,9 @@ typedef struct _GUID #endif #endif -#if defined(Q_OS_DARWIN) || defined(Q_QDOC) +#if defined(Q_OS_DARWIN) Q_FORWARD_DECLARE_CF_TYPE(CFUUID); -# if defined(__OBJC__) || defined(Q_QDOC) Q_FORWARD_DECLARE_OBJC_CLASS(NSUUID); -# endif #endif QT_BEGIN_NAMESPACE @@ -210,10 +208,8 @@ public: #if defined(Q_OS_DARWIN) || defined(Q_QDOC) static QUuid fromCFUUID(CFUUIDRef uuid); CFUUIDRef toCFUUID() const Q_DECL_CF_RETURNS_RETAINED; -# if defined(__OBJC__) || defined(Q_QDOC) static QUuid fromNSUUID(const NSUUID *uuid); NSUUID *toNSUUID() const Q_DECL_NS_RETURNS_AUTORELEASED; -# endif #endif uint data1; diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index bf4175d67e..35efd5d6a9 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -56,11 +56,9 @@ #error qbytearray.h must be included before any header file that defines truncate #endif -#if defined(Q_OS_MAC) || defined(Q_QDOC) +#if defined(Q_OS_MAC) Q_FORWARD_DECLARE_CF_TYPE(CFData); -# if defined(__OBJC__) || defined(Q_QDOC) Q_FORWARD_DECLARE_OBJC_CLASS(NSData); -# endif #endif QT_BEGIN_NAMESPACE @@ -389,12 +387,10 @@ public: static QByteArray fromRawCFData(CFDataRef data); CFDataRef toCFData() const Q_DECL_CF_RETURNS_RETAINED; CFDataRef toRawCFData() const Q_DECL_CF_RETURNS_RETAINED; -# if defined(__OBJC__) || defined(Q_QDOC) static QByteArray fromNSData(const NSData *data); static QByteArray fromRawNSData(const NSData *data); NSData *toNSData() const Q_DECL_NS_RETURNS_AUTORELEASED; NSData *toRawNSData() const Q_DECL_NS_RETURNS_AUTORELEASED; -# endif #endif typedef char *iterator; diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index a9271ef177..f698ec3221 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -46,11 +46,9 @@ #include -#if defined(Q_OS_MAC) || defined(Q_QDOC) +#if defined(Q_OS_MAC) Q_FORWARD_DECLARE_CF_TYPE(CFDate); -# if defined(__OBJC__) || defined(Q_QDOC) Q_FORWARD_DECLARE_OBJC_CLASS(NSDate); -# endif #endif QT_BEGIN_NAMESPACE @@ -316,10 +314,8 @@ public: #if defined(Q_OS_MAC) || defined(Q_QDOC) static QDateTime fromCFDate(CFDateRef date); CFDateRef toCFDate() const Q_DECL_CF_RETURNS_RETAINED; -# if defined(__OBJC__) || defined(Q_QDOC) static QDateTime fromNSDate(const NSDate *date); NSDate *toNSDate() const Q_DECL_NS_RETURNS_AUTORELEASED; -# endif #endif private: diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 71d6e6c762..6599a5b18c 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -68,11 +68,9 @@ namespace std #error qstring.h must be included before any header file that defines truncate #endif -#if defined(Q_OS_MAC) || defined(Q_QDOC) +#if defined(Q_OS_MAC) Q_FORWARD_DECLARE_CF_TYPE(CFString); -# if defined(__OBJC__) || defined(Q_QDOC) Q_FORWARD_DECLARE_OBJC_CLASS(NSString); -# endif #endif QT_BEGIN_NAMESPACE @@ -783,10 +781,8 @@ public: #if defined(Q_OS_MAC) || defined(Q_QDOC) static QString fromCFString(CFStringRef string); CFStringRef toCFString() const Q_DECL_CF_RETURNS_RETAINED; -# if defined(__OBJC__) || defined(Q_QDOC) static QString fromNSString(const NSString *string); NSString *toNSString() const Q_DECL_NS_RETURNS_AUTORELEASED; -# endif #endif // compatibility struct Null { }; -- cgit v1.2.3