[webkit-dev] A platform define for the Cocoa port?
darin at apple.com
Wed Jun 28 11:26:37 PDT 2006
On Jun 28, 2006, at 11:15 AM, Kevin Ollivier wrote:
> While working on the wx port, I've noticed there are a number of
> places where there are __APPLE__ defines that will conflict with
> the wxWidgets port because wxWidgets uses Carbon and so the Cocoa
> defines, native data types, etc. aren't appropriate in this case.
> What I was thinking is that we can add a PLATFORM(COCOA) define to
> Platform.h and define it when __OBJC__ and __APPLE__ are defined.
> Would this be an acceptable solution? This would still cause
> conflicts with our wxCocoa port, but unfortunately development work
> on that port has stalled so IMHO the conflict is not a major issue
> at the moment. Eventually, if we do move to support wxCocoa, we
> could add some __BUILDING_WXCOCOA define and check for that in
> Platform.h before defining KXMLCORE_PLATFORM_COCOA.
There should definitely be a platform for the version of WebKit
that's built on top of AppKit; the original one that Apple ships and
that we use for most of our day to day development. I'm not sure the
name of it should be COCOA, though. We can discuss the best name for it.
But this platform switch should not be based on the __OBJC__ define.
That's only defined for Objective-C and Objective-C++ source files,
but the "WebKit on AppKit" platform affects the C++ and plain C
source files too.
There are some source files where we need __OBJC__ checks, just so
that we can compile them in pure C++ code, even on platforms that are
using Objective-C. And there are some __OBJC__ checks in there that
are just wrong and should instead be this new platform.
So, lets come up with a name for the platform, lets start using it,
but lets not use __OBJC__ to set its value.
More information about the webkit-dev