Cleanup: Made a macro to assert ARC is enabled. (flutter/engine#12701)

Cleanup: Made a macro to assert ARC is enabled (and its inverse).
This commit is contained in:
gaaclarke
2019-09-30 14:47:54 -07:00
committed by GitHub
parent 2d15e8bf6f
commit dac372684b
5 changed files with 16 additions and 24 deletions

View File

@@ -37,4 +37,12 @@
*/
#define FLUTTER_UNAVAILABLE(msg) __attribute__((__unavailable__(msg)))
#if __has_feature(objc_arc)
#define FLUTTER_ASSERT_ARC
#define FLUTTER_ASSERT_NOT_ARC #error ARC must be disabled!
#else
#define FLUTTER_ASSERT_ARC #error ARC must be enabled!
#define FLUTTER_ASSERT_NOT_ARC
#endif
#endif // FLUTTER_FLUTTERMACROS_H_

View File

@@ -4,15 +4,10 @@
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
#include "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterBinaryMessengerRelay.h"
#ifndef __has_feature
#define __has_feature(x) 0 /* for non-clang compilers */
#endif
#if !__has_feature(objc_arc)
#error ARC must be enabled!
#endif
FLUTTER_ASSERT_ARC
@interface FlutterBinaryMessengerRelayTest : XCTestCase
@end

View File

@@ -4,15 +4,10 @@
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
#include "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterEngine.h"
#ifndef __has_feature
#define __has_feature(x) 0 /* for non-clang compilers */
#endif
#if !__has_feature(objc_arc)
#error ARC must be enabled!
#endif
FLUTTER_ASSERT_ARC
@interface FlutteEngineTest : XCTestCase
@end

View File

@@ -4,15 +4,10 @@
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
#include "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h"
#ifndef __has_feature
#define __has_feature(x) 0 /* for non-clang compilers */
#endif
#if !__has_feature(objc_arc)
#error ARC must be enabled!
#endif
FLUTTER_ASSERT_ARC
@interface FlutterPluginAppLifeCycleDelegateTest : XCTestCase

View File

@@ -4,13 +4,12 @@
#import <OCMock/OCMock.h>
#import <XCTest/XCTest.h>
#include "flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h"
#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h"
#include "FlutterBinaryMessenger.h"
#if !__has_feature(objc_arc)
#error ARC must be enabled!
#endif
FLUTTER_ASSERT_ARC
extern NSNotificationName const FlutterViewControllerWillDealloc;