Andreas Andreas - 1 year ago 162
Objective-C Question

gcc define for Objective C

I have a header file that is included by

and by
sources. When a C source includes the file, I'd like to skip some lines that contain Objective C stuff. Thus, I was wondering if gcc has a builtin compiler define that is active whenever it is compiling an Objective C file, something similar to the
define that indicates that the compiler is currently compiling a C++ source. Is there an Objective C equivalent?

Of course, I could just
my own preprocessor symbol but I'd like to know whether gcc already has an inbuilt definition for this.

Answer Source

To answer my own question, gcc defines then __OBJC__ macro whenever it is compiling an Objective C source.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download