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 <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f34c5215f45a242962835c1174d79912a56e5410)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2023-06-05 16:58:22 +02:00 committed by Qt Cherry-pick Bot
parent 760c9d6a6a
commit 463a3d1f6a
2 changed files with 11 additions and 0 deletions

View File

@ -50,6 +50,7 @@
#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
# include <TargetConditionals.h>
# define Q_OS_APPLE
# if defined(TARGET_OS_MAC) && TARGET_OS_MAC
# define Q_OS_DARWIN
# define Q_OS_BSD4

View File

@ -23,6 +23,16 @@
\relates <QtSystemDetection>
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 <QtSystemDetection>
Defined on Apple operating systems such as \macos, iOS, watchOS, and tvOS.
*/
/*!