summaryrefslogtreecommitdiff
path: root/macosx/plugins/DFInput
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-04 03:07:44 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-07-04 03:07:44 +0000
commitdd7da2fae96b9ba6bdbc28f7b26469373801f21e (patch)
tree9faf6aa7f2fa2900dcabc3d88d11e87285693e9b /macosx/plugins/DFInput
parenta012af37d7bd3a972d2b3fbb7ed09bc8662e91eb (diff)
downloadpcsxr-dd7da2fae96b9ba6bdbc28f7b26469373801f21e.tar.gz
Make the plug-ins use ARC in 64-bit mode.
Change how the preprocessor macros are managed on OS X. Set the name of the product to the target name. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85795 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/DFInput')
-rw-r--r--macosx/plugins/DFInput/ARCBridge.h36
-rw-r--r--macosx/plugins/DFInput/DFInput.xcodeproj/project.pbxproj30
-rwxr-xr-xmacosx/plugins/DFInput/macsrc/ControllerList.m2
-rwxr-xr-xmacosx/plugins/DFInput/macsrc/PadController.m8
-rwxr-xr-xmacosx/plugins/DFInput/macsrc/PadView.m2
5 files changed, 65 insertions, 13 deletions
diff --git a/macosx/plugins/DFInput/ARCBridge.h b/macosx/plugins/DFInput/ARCBridge.h
new file mode 100644
index 00000000..ea274b84
--- /dev/null
+++ b/macosx/plugins/DFInput/ARCBridge.h
@@ -0,0 +1,36 @@
+//
+// ARCBridge.h
+// PPMacho
+//
+// Created by C.W. Betts on 12/23/12.
+//
+//
+
+#ifndef PPMacho_ARCBridge_h
+#define PPMacho_ARCBridge_h
+
+#if __has_feature(objc_arc)
+
+#define SUPERDEALLOC
+#define RELEASEOBJ(obj)
+#define RETAINOBJ(obj) obj
+#define RETAINOBJNORETURN(obj)
+#define AUTORELEASEOBJ(obj) obj
+#define AUTORELEASEOBJNORETURN(obj)
+#define BRIDGE(toType, obj) (__bridge toType)(obj)
+#define __arcweak __weak
+
+#else
+
+#define SUPERDEALLOC [super dealloc]
+#define RELEASEOBJ(obj) [obj release]
+#define RETAINOBJ(obj) [obj retain]
+#define RETAINOBJNORETURN(obj) [obj retain]
+#define AUTORELEASEOBJ(obj) [obj autorelease]
+#define AUTORELEASEOBJNORETURN(obj) [obj autorelease]
+#define BRIDGE(toType, obj) (toType)obj
+#define __arcweak
+
+#endif
+
+#endif
diff --git a/macosx/plugins/DFInput/DFInput.xcodeproj/project.pbxproj b/macosx/plugins/DFInput/DFInput.xcodeproj/project.pbxproj
index 8a802875..96b2b3bf 100644
--- a/macosx/plugins/DFInput/DFInput.xcodeproj/project.pbxproj
+++ b/macosx/plugins/DFInput/DFInput.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
2B679862069193F300E2BD4F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B679860069193F300E2BD4F /* Cocoa.framework */; };
2B679863069193F300E2BD4F /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B679861069193F300E2BD4F /* IOKit.framework */; };
552E4CBF1474739200FB231F /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 552E4CC11474739200FB231F /* Localizable.strings */; };
+ 558600701785138600CB3D85 /* ARCBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 5586006F1785138600CB3D85 /* ARCBridge.h */; };
71054E211204A49F00AC2CCB /* ForceFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 71054E201204A49F00AC2CCB /* ForceFeedback.framework */; };
7136F1DA1200E163001973D9 /* ControllerList.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E861A411FF75AC001C1826 /* ControllerList.h */; };
7136F1DB1200E163001973D9 /* ControllerList.m in Sources */ = {isa = PBXBuildFile; fileRef = 71E861A511FF75AC001C1826 /* ControllerList.m */; };
@@ -76,6 +77,7 @@
2B679860069193F300E2BD4F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
2B679861069193F300E2BD4F /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
552E4CC01474739200FB231F /* English */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
+ 5586006F1785138600CB3D85 /* ARCBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARCBridge.h; sourceTree = "<group>"; };
71054E201204A49F00AC2CCB /* ForceFeedback.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ForceFeedback.framework; path = /System/Library/Frameworks/ForceFeedback.framework; sourceTree = "<absolute>"; };
7136F51912011BB4001973D9 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = "<group>"; };
714FA82A11FC822A00517F47 /* analog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; lineEnding = 0; name = analog.c; path = ../../../plugins/dfinput/analog.c; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.c; };
@@ -209,6 +211,7 @@
714FA82911FC820D00517F47 /* macsrc */ = {
isa = PBXGroup;
children = (
+ 5586006F1785138600CB3D85 /* ARCBridge.h */,
71E861A411FF75AC001C1826 /* ControllerList.h */,
71E861A511FF75AC001C1826 /* ControllerList.m */,
71E861A811FF75AC001C1826 /* MappingCell.h */,
@@ -378,6 +381,7 @@
71C7B260130F3904004BF975 /* SDL_systhread_c.h in Headers */,
71C7B261130F3904004BF975 /* SDL_systhread.h in Headers */,
71C7B263130F3904004BF975 /* SDL_thread_c.h in Headers */,
+ 558600701785138600CB3D85 /* ARCBridge.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -524,6 +528,7 @@
71155B0D0FDFA2DE00EC0BC5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ "CLANG_ENABLE_OBJC_ARC[arch=x86_64]" = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
@@ -532,8 +537,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"PCSXRPLUG=DFInput",
- "_MACOSX=1",
SDL_AUDIO_DISABLED,
+ "$(inherited)",
);
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
GCC_WARN_UNKNOWN_PRAGMAS = NO;
@@ -544,8 +549,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LIBRARY_SEARCH_PATHS = .;
- PRODUCT_NAME = DFInput;
- SYMROOT = ../../build;
+ PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = psxplugin;
};
name = Debug;
@@ -553,6 +557,7 @@
71155B0E0FDFA2DE00EC0BC5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ "CLANG_ENABLE_OBJC_ARC[arch=x86_64]" = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
GCC_DYNAMIC_NO_PIC = NO;
@@ -561,8 +566,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREPROCESSOR_DEFINITIONS = (
"PCSXRPLUG=DFInput",
- "_MACOSX=1",
SDL_AUDIO_DISABLED,
+ "$(inherited)",
);
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
GCC_WARN_UNKNOWN_PRAGMAS = NO;
@@ -573,8 +578,7 @@
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Playstation Emulator Plugins";
LIBRARY_SEARCH_PATHS = .;
- PRODUCT_NAME = DFInput;
- SYMROOT = ../../build;
+ PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = psxplugin;
};
name = Release;
@@ -588,8 +592,12 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEBUG_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = "_MACOSX=1";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "_MACOSX=1",
+ "$(DEBUG_PREPROCESSOR_DEFINITIONS)",
+ );
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
@@ -607,7 +615,6 @@
OTHER_CFLAGS = "";
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
- SYMROOT = ../../build;
VALID_ARCHS = "i386 x86_64";
};
name = Debug;
@@ -621,8 +628,12 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEBUG_PREPROCESSOR_DEFINITIONS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
- GCC_PREPROCESSOR_DEFINITIONS = "_MACOSX=1";
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "_MACOSX=1",
+ "$(DEBUG_PREPROCESSOR_DEFINITIONS)",
+ );
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
@@ -638,7 +649,6 @@
MACOSX_DEPLOYMENT_TARGET = 10.6;
OTHER_CFLAGS = "";
SDKROOT = macosx;
- SYMROOT = ../../build;
VALID_ARCHS = "i386 x86_64";
};
name = Release;
diff --git a/macosx/plugins/DFInput/macsrc/ControllerList.m b/macosx/plugins/DFInput/macsrc/ControllerList.m
index 3a6ec11c..609af2e2 100755
--- a/macosx/plugins/DFInput/macsrc/ControllerList.m
+++ b/macosx/plugins/DFInput/macsrc/ControllerList.m
@@ -33,10 +33,12 @@ static int currentController;
return self;
}
+#if !__has_feature(objc_arc)
- (void)dealloc
{
[super dealloc];
}
+#endif
/* sets current controller data returned by data source */
+ (void)setCurrentController:(int)which
diff --git a/macosx/plugins/DFInput/macsrc/PadController.m b/macosx/plugins/DFInput/macsrc/PadController.m
index 2cc01b7d..e2b28ea9 100755
--- a/macosx/plugins/DFInput/macsrc/PadController.m
+++ b/macosx/plugins/DFInput/macsrc/PadController.m
@@ -22,6 +22,7 @@
#import <Cocoa/Cocoa.h>
#import "PadController.h"
#include "pad.h"
+#import "ARCBridge.h"
static NSWindow *padWindow = nil;
static PadController *padController = nil;
@@ -37,10 +38,11 @@ void DoAbout() {
NSString *path = [bundle pathForResource:@"Credits" ofType:@"rtf"];
NSAttributedString *credits;
if (path) {
- credits = [[[NSAttributedString alloc] initWithPath: path
- documentAttributes:NULL] autorelease];
+ credits = [[NSAttributedString alloc] initWithPath: path
+ documentAttributes:NULL];
+ AUTORELEASEOBJNORETURN(credits);
} else {
- credits = [[[NSAttributedString alloc] initWithString:@""] autorelease];
+ credits = AUTORELEASEOBJ([[NSAttributedString alloc] initWithString:@""]);
}
// Get Application Icon
diff --git a/macosx/plugins/DFInput/macsrc/PadView.m b/macosx/plugins/DFInput/macsrc/PadView.m
index f9da9f09..ea81f9ac 100755
--- a/macosx/plugins/DFInput/macsrc/PadView.m
+++ b/macosx/plugins/DFInput/macsrc/PadView.m
@@ -33,11 +33,13 @@
return self;
}
+#if !__has_feature(objc_arc)
- (void)dealloc
{
[controller release];
[super dealloc];
}
+#endif
- (void)drawRect:(NSRect)rect
{