diff options
Diffstat (limited to 'macosx/plugins/DFNet/macsrc')
| -rw-r--r-- | macosx/plugins/DFNet/macsrc/ARCBridge.h | 36 | ||||
| -rwxr-xr-x | macosx/plugins/DFNet/macsrc/PluginConfigController.m | 8 | ||||
| -rwxr-xr-x | macosx/plugins/DFNet/macsrc/SockDialog.m | 6 |
3 files changed, 46 insertions, 4 deletions
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 |
