VTK  9.3.20240425
vtkCocoaMacOSXSDKCompatibility.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
13#include <AvailabilityMacros.h>
14
15#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
16#error VTK requires the Mac OS X 10.7 SDK or later
17#endif
18
19#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
20#error VTK requires a deployment target of Mac OS X 10.7 or later
21#endif
22
23// Stop AssertMacros.h from defining its macros without underscore prefixes,
24// which pollute the global namespace and cause us build issues.
25// This is default as of the macOS 10.13 SDK, but needed for older SDKs.
26#if MAC_OS_X_VERSION_MAX_ALLOWED < 101300
27#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
28#endif
29
30#if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !defined(VTK_DONT_MAP_10_12_ENUMS)
31// The 10.12 SDK made a bunch of enum names more logical, map old names to new names to continue
32// supporting old SDKs.
33#define NSWindowStyleMask NSUInteger
34#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
35#define NSWindowStyleMaskTitled NSTitledWindowMask
36#define NSWindowStyleMaskClosable NSClosableWindowMask
37#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
38#define NSWindowStyleMaskResizable NSResizableWindowMask
39
40#define NSEventModifierFlagShift NSShiftKeyMask
41#define NSEventModifierFlagControl NSControlKeyMask
42#define NSEventModifierFlagOption NSAlternateKeyMask
43#define NSEventModifierFlagCommand NSCommandKeyMask
44
45#define NSEventTypeKeyDown NSKeyDown
46#define NSEventTypeKeyUp NSKeyUp
47#define NSEventTypeApplicationDefined NSApplicationDefined
48#define NSEventTypeFlagsChanged NSFlagsChanged
49
50#define NSEventMaskAny NSAnyEventMask
51#endif
52
53// Create handy #defines that indicate the Objective-C memory management model.
54// Manual Retain Release, Automatic Reference Counting, or Garbage Collection.
55#if defined(__OBJC_GC__)
56#define VTK_OBJC_IS_MRR 0
57#define VTK_OBJC_IS_ARC 0
58#define VTK_OBJC_IS_GC 1
59#elif __has_feature(objc_arc)
60#define VTK_OBJC_IS_MRR 0
61#define VTK_OBJC_IS_ARC 1
62#define VTK_OBJC_IS_GC 0
63#else
64#define VTK_OBJC_IS_MRR 1
65#define VTK_OBJC_IS_ARC 0
66#define VTK_OBJC_IS_GC 0
67#endif
68
69#if __has_feature(objc_arc)
70#error VTK does not yet support ARC memory management
71#endif
72
73// VTK-HeaderTest-Exclude: vtkCocoaMacOSXSDKCompatibility.h