Commit 544035e0 authored by Brendan Shanks's avatar Brendan Shanks

macOS: Use ObjC generics to fix Xcode 10 warnings

parent 935f7626
......@@ -15,7 +15,9 @@
#import <AppKit/AppKit.h>
#import <WebKit/WebKit.h>
@class GVAttributeSchema;
@class GVDocument;
@class GVGraphDefaultAttributes;
@interface GVAttributeInspectorController : NSWindowController {
IBOutlet NSToolbar *componentToolbar;
......@@ -26,8 +28,10 @@
IBOutlet NSTableView *attributeTable;
IBOutlet WebView *documentationWeb;
NSDictionary *_allSchemas;
NSMutableDictionary *_allAttributes;
// 'NSDictionary<NSToolbarItemIdentifier, NSArray<GVAttributeSchema *> *>'
__GENERICS(NSDictionary, NSToolbarItemIdentifier, __GENERICS(NSArray, GVAttributeSchema *) *) *_allSchemas;
// 'NSMutableDictionary<NSToolbarItemIdentifier, GVGraphDefaultAttributes *>'
__GENERICS(NSMutableDictionary, NSToolbarItemIdentifier, GVGraphDefaultAttributes *) *_allAttributes;
GVDocument *_inspectedDocument;
BOOL _otherChangedGraph;
......
......@@ -15,4 +15,19 @@
#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>
#import <Quartz/Quartz.h>
#ifndef __has_feature
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
// Macros to use ObjC generics but keep compatibility with older Xcode versions
// from https://gist.github.com/smileyborg/d513754bc1cf41678054
#if __has_feature(objc_generics)
# define __GENERICS(class, ...) class<__VA_ARGS__>
# define __GENERICS_TYPE(type) type
#else
# define __GENERICS(class, ...) class
# define __GENERICS_TYPE(type) id
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment