From 0a5fa6ff397da27be4d0f45fc9e57771d1524fde Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 29 Sep 2012 09:58:36 -0700 Subject: [PATCH] Don't use ARC in the Obj-C++ code It never allocated any non-autoreleased objects so ARC wasn't actually doing anything other than breaking compilation with gcc. --- aegisub/libaegisub/Makefile | 1 - aegisub/libaegisub/osx/util.mm | 2 +- aegisub/src/Makefile | 1 - aegisub/src/osx_utils.mm | 10 +--------- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/aegisub/libaegisub/Makefile b/aegisub/libaegisub/Makefile index e34bbb506..4c2665ae5 100644 --- a/aegisub/libaegisub/Makefile +++ b/aegisub/libaegisub/Makefile @@ -44,7 +44,6 @@ SRC += \ ifeq (yes, $(BUILD_DARWIN)) SRC += osx/util.mm -osx/util.o: OBJCXXFLAGS += -fobjc-arc endif HEADER += \ diff --git a/aegisub/libaegisub/osx/util.mm b/aegisub/libaegisub/osx/util.mm index 41297ccbb..01164033d 100644 --- a/aegisub/libaegisub/osx/util.mm +++ b/aegisub/libaegisub/osx/util.mm @@ -84,7 +84,7 @@ std::string OSX_GetBundleAuxillaryExecutablePath(std::string const& executableNa void OSX_OpenLocation(std::string const& location) { @autoreleasepool { NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:location.c_str()]]; - LSOpenCFURLRef((__bridge CFURLRef)url, NULL); + LSOpenCFURLRef((CFURLRef)url, NULL); } } diff --git a/aegisub/src/Makefile b/aegisub/src/Makefile index 035d3e3f4..3050038c3 100644 --- a/aegisub/src/Makefile +++ b/aegisub/src/Makefile @@ -20,7 +20,6 @@ LDFLAGS += $(LDFLAGS_CCMALLOC) ifeq (yes, $(BUILD_DARWIN)) SRC += osx_utils.mm -osx_utils.o: OBJCXXFLAGS += -fobjc-arc endif ############### diff --git a/aegisub/src/osx_utils.mm b/aegisub/src/osx_utils.mm index 18777e068..12f0edd6b 100644 --- a/aegisub/src/osx_utils.mm +++ b/aegisub/src/osx_utils.mm @@ -23,14 +23,6 @@ #include "config.h" -// This bit of awfulness is to disable some ARC-incompatible stuff in window.h -// that we don't need -#include -#undef wxOSX_USE_COCOA_OR_IPHONE -#define wxOSX_USE_COCOA_OR_IPHONE 0 -class WXDLLIMPEXP_FWD_CORE wxWidgetImpl; -typedef wxWidgetImpl wxOSXWidgetImpl; - #include #import @@ -46,7 +38,7 @@ void AddFullScreenButton(wxWindow *window) { } void SetFloatOnParent(wxWindow *window) { - __unsafe_unretained NSWindow *nsWindow = [window->GetHandle() window]; + __block NSWindow *nsWindow = [window->GetHandle() window]; [nsWindow setLevel:NSFloatingWindowLevel]; if (!([nsWindow collectionBehavior] & NSWindowCollectionBehaviorFullScreenPrimary))