• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Force C compilation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Force C compilation


  • Subject: Re: Force C compilation
  • From: Steve Christensen <email@hidden>
  • Date: Fri, 6 Oct 2006 11:18:18 -0700

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


References: 
 >Force C compilation (From: Doug McLean <email@hidden>)

  • Prev by Date: Force C compilation
  • Next by Date: Re: Post link build step
  • Previous by thread: Force C compilation
  • Next by thread: Re: Force C compilation
  • Index(es):
    • Date
    • Thread