[webkit-dev] Rename PLATFORM(MAC) to PLATFORM(COCOA)?

Darin Adler darin at apple.com
Sat Jan 11 15:50:21 PST 2014

On Jan 11, 2014, at 3:36 PM, Maciej Stachowiak <mjs at apple.com> wrote:

> Ideally it should be USE(THE_SPECIFIC_FRAMEWORK_IN_QUESTION). I would guess that much of PLATFORM(MAC) that is valid for both Mac and iOS should actually be USE(FOUNDATION). PLATFORM really shouldn't be used for things other than terminal platform names. USE(COCOA) would be an ok stopgap if sorting down to more specific conditionals delays this cleanup too much.

Sorting down to specific conditionals will definitely delay the cleanup too much!

Thinking about USE(FOUNDATION) and looking at code it’s clear that the Mac and iOS ports have a lot more in common than Foundation. I saw that looking at PLATFORM(MAC) code snippets.

But as long as we’re going to have something incorrect as a first approximation, I don’t think that incorrect uses of USE(FOUNDATION) are significantly worse than incorrect uses of USE(COCOA). If long term there is not supposed to be such a thing as USE(COCOA), then I would hate to add it and then have to remove it later.

It remains clear to me that a valuable and quick first step is to mechanically change PLATFORM(MAC) to BAR, and I am OK with BAR being USE(FOUNDATION), USE(COCOA), or PLATFORM(COCOA).

I am sure there is a lot of easy refinement we can do immediately after. For example, we can change BAR && !PLATFORM(IOS) back to PLATFORM(MAC), if we can’t find an even better conditional. Maybe our first step can even be clever and not ever change such things to BAR, as suggested by Dan.

I’d like to play the numbers game, so if our best guess is that most PLATFORM(MAC) should be USE(FOUNDATION), I would choose that for BAR.

— Darin

More information about the webkit-dev mailing list