From bb4ac488bc1445ecd8a94eaff0ebab84b20a5eae Mon Sep 17 00:00:00 2001 From: alex-hofsteede Date: Wed, 20 Nov 2013 15:04:05 -0800 Subject: [PATCH] Add preproccessor check to make sure that files are compiled with ARC --- Mixpanel/MPSurvey.m | 4 ++++ Mixpanel/MPSurveyNavigationController.m | 4 ++++ Mixpanel/MPSurveyQuestion.m | 4 ++++ Mixpanel/MPSurveyQuestionViewController.m | 4 ++++ Mixpanel/Mixpanel.m | 6 +++++- Mixpanel/NSData+MPBase64.m | 4 ++++ Mixpanel/UIImage+MPAverageColor.m | 4 ++++ Mixpanel/UIImage+MPImageEffects.m | 4 ++++ Mixpanel/UIView+MPSnapshotImage.m | 4 ++++ 9 files changed, 37 insertions(+), 1 deletion(-) diff --git a/Mixpanel/MPSurvey.m b/Mixpanel/MPSurvey.m index 59678f154..6f8826a04 100644 --- a/Mixpanel/MPSurvey.m +++ b/Mixpanel/MPSurvey.m @@ -1,3 +1,7 @@ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import "MPSurvey.h" #import "MPSurveyQuestion.h" diff --git a/Mixpanel/MPSurveyNavigationController.m b/Mixpanel/MPSurveyNavigationController.m index 624f2bacc..ffa123790 100644 --- a/Mixpanel/MPSurveyNavigationController.m +++ b/Mixpanel/MPSurveyNavigationController.m @@ -1,3 +1,7 @@ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import #import diff --git a/Mixpanel/MPSurveyQuestion.m b/Mixpanel/MPSurveyQuestion.m index d80a3f559..0ff58c994 100644 --- a/Mixpanel/MPSurveyQuestion.m +++ b/Mixpanel/MPSurveyQuestion.m @@ -1,3 +1,7 @@ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import "MPSurveyQuestion.h" static NSString *MPSurveyQuestionTypeMultipleChoice = @"multiple_choice"; diff --git a/Mixpanel/MPSurveyQuestionViewController.m b/Mixpanel/MPSurveyQuestionViewController.m index 8e3837818..2c66ebd9a 100644 --- a/Mixpanel/MPSurveyQuestionViewController.m +++ b/Mixpanel/MPSurveyQuestionViewController.m @@ -1,3 +1,7 @@ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import #import "MPSurveyQuestionViewController.h" diff --git a/Mixpanel/Mixpanel.m b/Mixpanel/Mixpanel.m index c12776f8f..ef78dc279 100755 --- a/Mixpanel/Mixpanel.m +++ b/Mixpanel/Mixpanel.m @@ -16,6 +16,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #include #include #include @@ -34,7 +38,7 @@ #import "NSData+MPBase64.h" #import "UIView+MPSnapshotImage.h" -#define VERSION @"2.1.0" +#define VERSION @"2.2.0" #ifdef MIXPANEL_LOG #define MixpanelLog(...) NSLog(__VA_ARGS__) diff --git a/Mixpanel/NSData+MPBase64.m b/Mixpanel/NSData+MPBase64.m index e2f00f39b..78ee140cb 100644 --- a/Mixpanel/NSData+MPBase64.m +++ b/Mixpanel/NSData+MPBase64.m @@ -12,6 +12,10 @@ // appreciated but not required. // +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import "NSData+MPBase64.h" // diff --git a/Mixpanel/UIImage+MPAverageColor.m b/Mixpanel/UIImage+MPAverageColor.m index 4c4e31892..3b9ab03c5 100644 --- a/Mixpanel/UIImage+MPAverageColor.m +++ b/Mixpanel/UIImage+MPAverageColor.m @@ -1,3 +1,7 @@ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import "UIImage+MPAverageColor.h" @implementation UIImage (MPAverageColor) diff --git a/Mixpanel/UIImage+MPImageEffects.m b/Mixpanel/UIImage+MPImageEffects.m index 8a8006c18..282a5b11f 100644 --- a/Mixpanel/UIImage+MPImageEffects.m +++ b/Mixpanel/UIImage+MPImageEffects.m @@ -93,6 +93,10 @@ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 5/3/2013 */ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import "UIImage+MPImageEffects.h" #import diff --git a/Mixpanel/UIView+MPSnapshotImage.m b/Mixpanel/UIView+MPSnapshotImage.m index 311a83f0c..7822c667e 100644 --- a/Mixpanel/UIView+MPSnapshotImage.m +++ b/Mixpanel/UIView+MPSnapshotImage.m @@ -1,3 +1,7 @@ +#if ! __has_feature(objc_arc) +#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file. +#endif + #import #import "UIView+MPSnapshotImage.h"