[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: combining a objc header with a c header
From: |
Nicola Pero |
Subject: |
Re: combining a objc header with a c header |
Date: |
Wed, 9 Jan 2002 13:51:01 +0000 (GMT) |
Sorry for answering late ... problem being that gnu.gnustep.* newsgroups
are *not* mirrored to the mailing list ... while the mailing list is being
mirrored on the newsgroups ... so we never read your message.
>I am writing a library in c but I would like to implement a objc wrapper
>aswell.
>
>Is it possible to include in the header file c syntax as well as objc
>syntax.
>
>For example
>
>#ifdef COMPILING_C
>
>...lots of code...
>
>#endif
>
>#ifdef COMPILING_OBJC
>
>...lots of code...
>
>#endif
The Objective-C compiler can compile perfectly well C code ... so the C
code can be compiled both in C and in Objective-C ... you don't need to
protect it.
The C compiler can not compile Objective-C code, so you need to protect
the Objective-C code when you compile in C. You can simply use something
like
#ifdef __OBJC__
#endif
__OBJC__ is defined by the compiler if and only if it is the Objective-C
compiler.
- Re: combining a objc header with a c header,
Nicola Pero <=