Bug 108007
Summary: | Stop defining PLATFORM(MAC) when building for PLATFORM(IOS) and PLATFORM(IOS_SIMULATOR) | ||
---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | abarth, benjamin, darin, laszlo.gombos, mitz, mjs, sam |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
David Kilzer (:ddkilzer)
We should stop defining PLATFORM(MAC) when building for PLATFORM(IOS) and PLATFORM(IOS_SIMULATOR) for the following reasons:
- Require contributors to be explicit about whether code supports both Mac and iOS.
- Make it explicit about which code supports iOS (so searching for "PLATFORM(IOS)" is meaningful).
- Make Mac-only code use "PLATFORM(MAC)" instead of "PLATFORM(MAC) && !PLATFORM(IOS)".
- Make it obvious when an ENABLE() or USE() macro should replace "PLATFORM(MAC) || PLATFORM(IOS)".
- Make the case in the future for a PLATFORM(_FOO_) macro that represents "PLATFORM(MAC) || PLATFORM(IOS)".
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
Looking at making a patch for this, I wonder if this would be a better change:
- Stop defining PLATFORM(MAC) when building for PLATFORM(IOS) and PLATFORM(IOS_SIMULATOR).
- Rename OS(DARWIN) to OS(APPLE).
- Replace "PLATFORM(MAC) || PLATFORM(IOS)" with OS(APPLE) (unless a better ENABLE() or USE() macro applies).
I know OS(DARWIN) is supped to represent the kernel or low-level parts of the operating system, but I think it works both to represent the kernel as well as the UI-level parts of the operating system. And it's defined when __APPLE__ is defined.
I was originally going to add a PLATFORM(APPLE) macro along side OS(DARWIN), but it didn't seem to make sense to use "OS(DARWIN)" when "OS(APPLE)" is more generally useful.
David Kilzer (:ddkilzer)
(In reply to comment #1)
> I was originally going to add a PLATFORM(APPLE) macro along side OS(DARWIN), but it didn't seem to make sense to use "OS(DARWIN)" when "OS(APPLE)" is more generally useful.
And both Mac OS X and iOS are Apple operating systems!
Laszlo Gombos
David, FYI - I changed Platform.h to follow the direction you set (without introducing the new defines) as part of bug 105735.
Maciej Stachowiak
I think it makes sense to have a single macro that means PLATFORM(MAC) || PLATFORM(IOS) (effectively). But it should not be an OS() macro - those are supposed to be for low-level system things - cases where different top-level ports might build on the same underlying OS. So if we make a shared one, it should probably be a PLATFORM() macro, not OS(). Another idea besides PLATFORM(APPLE) might be PLATFORM(COCOA) (to the extent that Cocoa Touch is a form of Cocoa).
Maciej Stachowiak
BTW, I forgot to mention, but I agree with this basic idea of splitting MAC and IOS.
David Kilzer (:ddkilzer)
Another reason to stop defining PLATFORM(MAC) when building iOS:
<http://trac.webkit.org/changeset/140988>
David Kilzer (:ddkilzer)
I think Dan Bernstein fixed this already. Is there anything left to do here?
mitz
(In reply to comment #7)
> I think Dan Bernstein fixed this already. Is there anything left to do here?
Yes, this was fixed as bug 128952. I didn’t know that this earlier bug existed when I filed that one.
David Kilzer (:ddkilzer)
*** This bug has been marked as a duplicate of bug 128952 ***