From dd7da2fae96b9ba6bdbc28f7b26469373801f21e Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Thu, 4 Jul 2013 03:07:44 +0000 Subject: 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 --- macosx/plugins/DFNet/macsrc/ARCBridge.h | 36 ++++++++++++++++++++++ .../plugins/DFNet/macsrc/PluginConfigController.m | 8 +++-- macosx/plugins/DFNet/macsrc/SockDialog.m | 6 +++- 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 macosx/plugins/DFNet/macsrc/ARCBridge.h (limited to 'macosx/plugins/DFNet/macsrc') diff --git a/macosx/plugins/DFNet/macsrc/ARCBridge.h b/macosx/plugins/DFNet/macsrc/ARCBridge.h new file mode 100644 index 00000000..ea274b84 --- /dev/null +++ b/macosx/plugins/DFNet/macsrc/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/DFNet/macsrc/PluginConfigController.m b/macosx/plugins/DFNet/macsrc/PluginConfigController.m index 063e83e6..ddd3e8c7 100755 --- a/macosx/plugins/DFNet/macsrc/PluginConfigController.m +++ b/macosx/plugins/DFNet/macsrc/PluginConfigController.m @@ -21,6 +21,7 @@ #import "PluginConfigController.h" #include "dfnet.h" +#import "ARCBridge.h" NSString * const kIPADDRKEY = @"IP Address"; NSString * const kIPPORT = @"IP Port"; @@ -41,10 +42,11 @@ void AboutDlgProc() 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/DFNet/macsrc/SockDialog.m b/macosx/plugins/DFNet/macsrc/SockDialog.m index feee77d8..f175e7fa 100755 --- a/macosx/plugins/DFNet/macsrc/SockDialog.m +++ b/macosx/plugins/DFNet/macsrc/SockDialog.m @@ -10,6 +10,7 @@ #include "dfnet.h" #import "EmuThread.h" +#import "ARCBridge.h" void SysMessage(const char *fmt, ...) { @@ -72,7 +73,8 @@ void sockDestroyWaitDlg() dispatch_sync(dispatch_get_main_queue(), ^{ if (globalSock != nil) { [globalSock close]; - [globalSock release]; + + RELEASEOBJ(globalSock); globalSock = nil; } }); @@ -92,10 +94,12 @@ void sockDestroyWaitDlg() return self; } +#if !__has_feature(objc_arc) -(void)dealloc { [super dealloc]; } +#endif @end -- cgit v1.2.3