• 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: 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
  • Prev by Date: Xcode always rebuilds all for project on external volume
  • Next by Date: Compiling different prefix headers based on i386 or ppc?
  • Previous by thread: Re: Force C compilation
  • Next by thread: OpenGL error
  • Index(es):
    • Date
    • Thread