I have a project for iPhone configured to compile for armv6 and armv7 architectures. And I need to exclude some code from compiling for armv6 architecture because it causes runtime crash on device (bad instruction exception).
Is there a define for armv6/armv7 compilation paths (such as “_DEBUG”)?
First off, you don’t need to prevent them from compiling, you need to prevent them from being executed. The crash is at runtime, after all, not compile time.
That said, the easiest way to do this is to have two code paths, and compile the appropriate section based on architecture: