I’d like to use an assert macro that wraps both NSAssert for ObjC methods, and plain assert (or something else) inside of C functions.
Is there a clean way to detect at runtime (or better yet, compile time!) that I’m currently executing inside an ObjC method?
I know that self and _cmd will be defined and valid within a method, but I’m not sure if there’s an obvious way to safely check for the existence of a local variable. Am I forgetting something obvious?
Maybe you can use the standard predefined macro to test if the file is compiled by an objective-c compiler.