From 463a3d1f6a329a39c5ab53ae54cfefd20745c558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 5 Jun 2023 16:58:22 +0200 Subject: [PATCH] Add Q_OS_APPLE define on Apple operating systems It's quite common that macOS and iOS share backends, for example due to the functionality being part of one of the Apple core frameworks. In this case the support isn't directly tied to the Darwin kernel per se, so let's use a more general define to refer to the union of Apple based features. Change-Id: I71cac5ec1d74cd86eba67a64b20846e48c9f05c5 Reviewed-by: Timur Pocheptsov Reviewed-by: Thiago Macieira (cherry picked from commit f34c5215f45a242962835c1174d79912a56e5410) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qsystemdetection.h | 1 + src/corelib/global/qsystemdetection.qdoc | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h index 50acd688d64..77d22917d3e 100644 --- a/src/corelib/global/qsystemdetection.h +++ b/src/corelib/global/qsystemdetection.h @@ -50,6 +50,7 @@ #if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__)) # include +# define Q_OS_APPLE # if defined(TARGET_OS_MAC) && TARGET_OS_MAC # define Q_OS_DARWIN # define Q_OS_BSD4 diff --git a/src/corelib/global/qsystemdetection.qdoc b/src/corelib/global/qsystemdetection.qdoc index 210f865ffe6..11750e8cf73 100644 --- a/src/corelib/global/qsystemdetection.qdoc +++ b/src/corelib/global/qsystemdetection.qdoc @@ -23,6 +23,16 @@ \relates Defined on Darwin-based operating systems such as \macos, iOS, watchOS, and tvOS. + + \note Unless you are dealing with code specific to the Darwin kernel, + prefer Q_OS_APPLE to refer to the family of Apple operating systems. +*/ + +/*! + \macro Q_OS_APPLE + \relates + + Defined on Apple operating systems such as \macos, iOS, watchOS, and tvOS. */ /*!