isBeingDebugged needs to always be NO in release builds as kinfo_proc offers no ABI...
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 17 Mar 2013 21:30:02 +0000 (22:30 +0100)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sun, 17 Mar 2013 21:30:02 +0000 (22:30 +0100)
Categories/NSProcessInfo+Debugging.m
Enjoyable.xcodeproj/project.pbxproj
Info.plist

index 649de3bca06ed3a9ab12b2f616ce282791487ce2..1356ae770b4168b335440f32b61d433928af593e 100644 (file)
@@ -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
index 890b562328134a724ac6add156b1e49fe3e2ff10..74db726c9433f0897e47b8babd0a1677c9044e46 100644 (file)
                                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;
index 393ccf5e6289308b0d1b5f29ce298b658494c161..93df827d3b62f030bdc40a496e5a58052dad2c82 100644 (file)
@@ -46,7 +46,7 @@
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
-       <string>482</string>
+       <string>483</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>NSHumanReadableCopyright</key>