Skip to content

Commit

Permalink
remove ARC feature test from implementation, add it to env conditiona…
Browse files Browse the repository at this point in the history
…l section of ofConstants.h
  • Loading branch information
2bbb committed Mar 17, 2022
1 parent cbef3f2 commit 96f11b8
Show file tree
Hide file tree
Showing 30 changed files with 9 additions and 116 deletions.
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/core/ofxiOSAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@

#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#import "ofxiOSViewController.h"
#import "ofxiOSGLKViewController.h"
#import "ofxiOSExternalDisplay.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/core/ofxiOSEAGLView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include <TargetConditionals.h>
#import <GameController/GameController.h>

#if !__has_feature(objc_arc)
# error need ARC
#endif

static ofxiOSEAGLView * _instanceRef = nil;

@interface ofxiOSEAGLView() {
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/core/ofxiOSGLKView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include <TargetConditionals.h>
#import <GameController/GameController.h>

#if !__has_feature(objc_arc)
# error need ARC
#endif

static ofxiOSGLKView * _instanceRef = nil;

@interface ofxiOSGLKView() {
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/core/ofxiOSGLKViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#include <TargetConditionals.h>
#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#import "ofxiOSGLKViewController.h"

#include "ofxiOSGLKView.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/core/ofxiOSViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#include <TargetConditionals.h>
#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#import <QuartzCore/QuartzCore.h>

#include "ofxiOSViewController.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/gl/EAGLKView.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#import "ES1Renderer.h"
#import "ES2Renderer.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

@interface EAGLKView() {
BOOL bInit;
}
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/gl/EAGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
* ***********************************************************************/


#if !__has_feature(objc_arc)
# error need ARC
#endif

#import <QuartzCore/QuartzCore.h>

#include <TargetConditionals.h>
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/gl/ES1Renderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

#import "ES1Renderer.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

@implementation ES1Renderer

// Create an OpenGL ES 1.1 context
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/gl/ES2Renderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

#import "ES2Renderer.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

@implementation ES2Renderer

// Create an OpenGL ES 2.0 context
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/AVSoundPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
#import "AVSoundPlayer.h"
#include <TargetConditionals.h>

#if !__has_feature(objc_arc)
# error need ARC
#endif

@interface AVSoundPlayer() {
BOOL bMultiPlay;
}
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/SoundInputStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#import "SoundInputStream.h"
#import <AVFoundation/AVFoundation.h>

#if !__has_feature(objc_arc)
# error need ARC
#endif

typedef struct {
AudioBufferList * bufferList;
AudioUnit remoteIO;
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/SoundOutputStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#import "SoundOutputStream.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

static OSStatus soundOutputStreamRenderCallback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/SoundStream.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#import "SoundStream.h"
#import <AVFoundation/AVFoundation.h>

#if !__has_feature(objc_arc)
# error need ARC
#endif

@interface SoundStream() {
//
}
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/ofxiOSSoundPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
#include "ofLog.h"
#import "AVSoundPlayer.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

using namespace std;

ofxiOSSoundPlayer::ofxiOSSoundPlayer() {
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/ofxiOSSoundStream.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
#import "SoundOutputStream.h"
#import <AVFoundation/AVFoundation.h>

#if !__has_feature(objc_arc)
# error need ARC
#endif

using namespace std;

//------------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/sound/ofxiOSSoundStreamDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#include "ofLog.h"
#include "ofSoundBuffer.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

@interface ofxiOSSoundStreamDelegate() {
std::function<void(ofSoundBuffer &)> inCallback;
std::function<void(ofSoundBuffer &)> outCallback;
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSCoreLocation.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
#include <TargetConditionals.h>
#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

//C++ class implementations

//--------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSCoreMotion.mm
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

#include "ofxiOSCoreMotion.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

ofxiOSCoreMotion::ofxiOSCoreMotion() {

motionManager = [[CMMotionManager alloc] init];
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSExtras.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
#include <TargetConditionals.h>
#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#import "ofxiOSAppDelegate.h"
#import "ofxiOSViewController.h"
#import "ofxiOSGLKViewController.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSImagePicker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

//C++ class implementations

//--------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSKeyboard.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

using namespace std;

#if !__has_feature(objc_arc)
# error need ARC
#endif

//C++ class implementations

//--------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSMapKit.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@

#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#include "ofxiOSMapKitDelegate.h"
#include "ofxiOSExtras.h"
#include "ofAppRunner.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/utils/ofxiOSMapKitDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@

#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#include "ofxiOSMapKitDelegate.h"
#include "ofxiOSMapKit.h"
#include "ofLog.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/video/AVFoundationVideoGrabber.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

#if TARGET_OS_IOS || (TARGET_OS_IPHONE && !TARGET_OS_TV)

#if !__has_feature(objc_arc)
# error need ARC
#endif

#include "ofxiOSExtras.h"
#include "ofAppRunner.h"
#include "ofLog.h"
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/video/AVFoundationVideoPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

#define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0)

#if !__has_feature(objc_arc)
# error need ARC
#endif

/* Asset keys */
NSString * const kTracksKey = @"tracks";
NSString * const kPlayableKey = @"playable";
Expand Down
4 changes: 0 additions & 4 deletions addons/ofxiOS/src/video/ofxiOSVideoPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

using namespace std;

#if !__has_feature(objc_arc)
# error need ARC
#endif

CVOpenGLESTextureCacheRef _videoTextureCache = NULL;
CVOpenGLESTextureRef _videoTextureRef = NULL;

Expand Down
9 changes: 9 additions & 0 deletions libs/openFrameworks/utils/ofConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ enum ofTargetPlatform{
#if defined(__LITTLE_ENDIAN__)
#define TARGET_LITTLE_ENDIAN // intel cpu
#endif

#if defined(__OBJC__) && !__has_feature(objc_arc)
#error "Please enable ARC (Automatic Reference Counting) at the project level"
#endif
#endif

#ifdef TARGET_LINUX
Expand Down Expand Up @@ -246,6 +250,11 @@ enum ofTargetPlatform{


#define TARGET_LITTLE_ENDIAN // arm cpu

#if defined(__OBJC__) && !__has_feature(objc_arc)
#error "Please enable ARC (Automatic Reference Counting) at the project level"
#endif

#endif

#ifdef TARGET_ANDROID
Expand Down
4 changes: 0 additions & 4 deletions libs/openFrameworks/video/ofAVFoundationGrabber.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

#ifdef OF_VIDEO_CAPTURE_AVF

#if !__has_feature(objc_arc)
# error need ARC
#endif

#import <Accelerate/Accelerate.h>

@interface OSXVideoGrabber ()
Expand Down
4 changes: 0 additions & 4 deletions libs/openFrameworks/video/ofAVFoundationPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include "ofTexture.h"
#endif

#if !__has_feature(objc_arc)
# error need ARC
#endif

//--------------------------------------------------------------
ofAVFoundationPlayer::ofAVFoundationPlayer() {
videoPlayer = nullptr;
Expand Down
4 changes: 0 additions & 4 deletions libs/openFrameworks/video/ofAVFoundationVideoPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

#import "ofAVFoundationVideoPlayer.h"

#if !__has_feature(objc_arc)
# error need ARC
#endif

#define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0)


Expand Down

0 comments on commit 96f11b8

Please sign in to comment.