From 99bb6bddccccd77d17ef7cc691b370cb727aa1a4 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sun, 17 Mar 2013 22:30:02 +0100 Subject: [PATCH] isBeingDebugged needs to always be NO in release builds as kinfo_proc offers no ABI guarantee. --- Categories/NSProcessInfo+Debugging.m | 4 ++++ Enjoyable.xcodeproj/project.pbxproj | 1 + Info.plist | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Categories/NSProcessInfo+Debugging.m b/Categories/NSProcessInfo+Debugging.m index 649de3b..1356ae7 100644 --- a/Categories/NSProcessInfo+Debugging.m +++ b/Categories/NSProcessInfo+Debugging.m @@ -17,6 +17,7 @@ @implementation NSProcessInfo (Debugging) - (BOOL)isBeingDebugged { +#ifdef DEBUG int mib[4]; struct kinfo_proc info; size_t size = sizeof(info); @@ -30,6 +31,9 @@ return sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0) == 0 && (info.kp_proc.p_flag & P_TRACED) != 0; +#else + return NO; +#endif } @end diff --git a/Enjoyable.xcodeproj/project.pbxproj b/Enjoyable.xcodeproj/project.pbxproj index 890b562..74db726 100644 --- a/Enjoyable.xcodeproj/project.pbxproj +++ b/Enjoyable.xcodeproj/project.pbxproj @@ -574,6 +574,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1"; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; diff --git a/Info.plist b/Info.plist index 393ccf5..93df827 100644 --- a/Info.plist +++ b/Info.plist @@ -46,7 +46,7 @@ CFBundleSignature ???? CFBundleVersion - 482 + 483 LSApplicationCategoryType public.app-category.utilities NSHumanReadableCopyright -- 2.30.2