diff --git a/engine/src/flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h b/engine/src/flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h index 51b27bb789..fc87878ce1 100644 --- a/engine/src/flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h +++ b/engine/src/flutter/shell/platform/darwin/common/framework/Headers/FlutterMacros.h @@ -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_ diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterBinaryMessengerRelayTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterBinaryMessengerRelayTest.mm index 08e07069c6..a0a0753d6f 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterBinaryMessengerRelayTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterBinaryMessengerRelayTest.mm @@ -4,15 +4,10 @@ #import #import +#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 diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm index cf96c2e716..a5641da0fb 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm @@ -4,15 +4,10 @@ #import #import +#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 diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m index 3a202d22da..4ce64acfc7 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegateTest.m @@ -4,15 +4,10 @@ #import #import +#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 diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.m b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.m index 22cdeb3d67..b33e8cda6f 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.m +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.m @@ -4,13 +4,12 @@ #import #import +#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;