Search guides and the APICtrl K
  1. API reference
  2. System, devices and network

apple_platform.h

Which Apple platform this is -- the Mac, or one of the UIKit ones.

#include <sonore/apple_platform.h>
On this page

Design notes

__APPLE__ says Apple and nothing more: it is defined for macOS, iOS, iPadOS, tvOS and visionOS alike. The files that grew up on the Mac test it alone and then reach for AppKit, the HAL and NSWindow, none of which exist on an iPhone. So the question is asked here, once, through Apple's own TargetConditionals.h, and answered as one macro:

SONORE_IOS
defined on the UIKit platforms (iOS, iPadOS, the iOS simulator, Mac Catalyst is NOT one of them: it has TARGET_OS_IPHONE but takes AppKit's place through UIKit and is not a target this SDK builds).
SONORE_MACOS
defined on macOS.

The syntax checks (SONORE_APPLE_SYNTAX_CHECK, tests/au_shim) compile the Apple files on Windows, where TargetConditionals.h does not exist: they read the Mac halves unless SONORE_IOS_SYNTAX_CHECK asks for the iOS ones.

Macros 2

↑↓ to move↵ to openEvery public name in the headers, and every guide