Re: Objective-C++
Re: Objective-C++
- Subject: Re: Objective-C++
- From: Uli Kusterer <email@hidden>
- Date: Tue, 12 Feb 2008 13:24:05 +0100
On 11.02.2008, at 18:06, Scott Andrew wrote:
We did a photoshop plugin at my day job using Objective C++. We
started the project by creating a Cocoa Plug-in then just changed
the file names to .mm and made sure we always created the names
with .mm.
IMHO it helps code organization (especially for cross-platform code)
if you try to keep C++, ObjC and ObjC++ separate. It means that all
your Mac-specific code is ObjC, all your platform-neutral code is C++,
and the glue between them is easily distinguishable because it's ObjC+
+. Makes it easier to avoid that anyone introduces code that may break
the other platforms.
On 11.02.2008, at 19:42, Simone Tellini wrote:
I usually set the "Compile Sources As" project option to "Objective-C
++" instead of bothering to rename all the files to .mm
I've had problems with this. There are subtle differences between
how C and C++ interpret the same (C-) statements. So, if you have to
keep using other peoples' C code and need to update it when they do,
if you do this compiler switch, you will suddenly get oodles of wrong
warnings from the C++ compiler, and on rare occasions even errors or
crashes. So, I like to compile everything the way it was specified as
its suffix, and if I have code that expects to be run through a C++
compiler, is external and has .c suffixes, I put them in a separate
project.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden