VTK  9.2.6
vtkCocoaMacOSXSDKCompatibility.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkCocoaMacOSXSDKCompatibility.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #include <AvailabilityMacros.h>
26 
27 #if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
28 #error VTK requires the Mac OS X 10.7 SDK or later
29 #endif
30 
31 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
32 #error VTK requires a deployment target of Mac OS X 10.7 or later
33 #endif
34 
35 // Stop AssertMacros.h from defining its macros without underscore prefixes,
36 // which pollute the global namespace and cause us build issues.
37 // This is default as of the macOS 10.13 SDK, but needed for older SDKs.
38 #if MAC_OS_X_VERSION_MAX_ALLOWED < 101300
39 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
40 #endif
41 
42 #if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !defined(VTK_DONT_MAP_10_12_ENUMS)
43 // The 10.12 SDK made a bunch of enum names more logical, map old names to new names to continue
44 // supporting old SDKs.
45 #define NSWindowStyleMask NSUInteger
46 #define NSWindowStyleMaskBorderless NSBorderlessWindowMask
47 #define NSWindowStyleMaskTitled NSTitledWindowMask
48 #define NSWindowStyleMaskClosable NSClosableWindowMask
49 #define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
50 #define NSWindowStyleMaskResizable NSResizableWindowMask
51 
52 #define NSEventModifierFlagShift NSShiftKeyMask
53 #define NSEventModifierFlagControl NSControlKeyMask
54 #define NSEventModifierFlagOption NSAlternateKeyMask
55 #define NSEventModifierFlagCommand NSCommandKeyMask
56 
57 #define NSEventTypeKeyDown NSKeyDown
58 #define NSEventTypeKeyUp NSKeyUp
59 #define NSEventTypeApplicationDefined NSApplicationDefined
60 #define NSEventTypeFlagsChanged NSFlagsChanged
61 
62 #define NSEventMaskAny NSAnyEventMask
63 #endif
64 
65 // Create handy #defines that indicate the Objective-C memory management model.
66 // Manual Retain Release, Automatic Reference Counting, or Garbage Collection.
67 #if defined(__OBJC_GC__)
68 #define VTK_OBJC_IS_MRR 0
69 #define VTK_OBJC_IS_ARC 0
70 #define VTK_OBJC_IS_GC 1
71 #elif __has_feature(objc_arc)
72 #define VTK_OBJC_IS_MRR 0
73 #define VTK_OBJC_IS_ARC 1
74 #define VTK_OBJC_IS_GC 0
75 #else
76 #define VTK_OBJC_IS_MRR 1
77 #define VTK_OBJC_IS_ARC 0
78 #define VTK_OBJC_IS_GC 0
79 #endif
80 
81 #if __has_feature(objc_arc)
82 #error VTK does not yet support ARC memory management
83 #endif
84 
85 // VTK-HeaderTest-Exclude: vtkCocoaMacOSXSDKCompatibility.h