Re: Force C compilation
Re: Force C compilation
- Subject: Re: Force C compilation
- From: Doug McLean <email@hidden>
- Date: Fri, 6 Oct 2006 15:27:44 -0600
Duh and thanks.
I use this construction all the time in header files, but I did not
think to use it for a function local to the implementation file.
Date: Fri, 6 Oct 2006 11:18:18 -0700
From: Steve Christensen <email@hidden>
Subject: Re: Force C compilation
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
On Oct 6, 2006, at 11:04 AM, Doug McLean wrote:
> Hello. I'm new to XCode and porting a CW project.
>
> This project contains both C and C++ source files, but I needed all
> to be compiled as C++. Therefore the "Compile Sources As" setting
> was imported as "C++".
>
> Now I need one file to be compiled as C. (It contains functions in
> assembly with non-mangled C names.) Is there a way to flag that one
> file for C compilation, perhaps with "Additional Compiler Flags"?
> Changing the filetype to C (in Get Info) does not do it.
>
> Thanks for any advice. I think I can unset the global C++ setting
> and then change the type manually for each file, but would like to
> find a clearer way.
Any reason you couldn't add this around the functions in that
particular file? Then you never have to worry about differences in
development environments...
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden