[Webkit-unassigned] [Bug 107406] Collapse PLATFORM(MAC)||PLATFORM(IOS) to just PLATFORM(MAC)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jan 21 12:51:56 PST 2013
https://bugs.webkit.org/show_bug.cgi?id=107406
David Kilzer (:ddkilzer) <ddkilzer at webkit.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mjs at apple.com
--- Comment #2 from David Kilzer (:ddkilzer) <ddkilzer at webkit.org> 2013-01-21 12:53:47 PST ---
(In reply to comment #1)
> Created an attachment (id=183694)
--> (https://bugs.webkit.org/attachment.cgi?id=183694&action=review) [details]
> proposed change
>
> I found having both "PLATFORM(MAC) && !PLATFORM(IOS)" and "PLATFORM(MAC) || PLATFORM(IOS)" around to be slightly confusing.
Defining PLATFORM(MAC) when building PLATFORM(IOS) was just a convenience for the iOS port since (more often than not) the Mac and iOS platforms share code. It's also a messy convenience because in a tree where iOS is merged with open source, the following macros have to be defined in these cases:
Mac only: PLATFORM(MAC) && !PLATFORM(IOS)
iOS only: PLATFORM(IOS)
Mac or iOS: PLATFORM(MAC) __or__ PLATFORM(MAC) || PLATFORM(IOS)
I see two problems with this:
1. Having to use "PLATFORM(MAC) && !PLATFORM(IOS)" when you only want to build code for Mac.
2. Reading "PLATFORM(MAC)" doesn't really evoke "this code is for both Mac and iOS".
A better long-term solution would be to:
- Not define PLATFORM(MAC) when building PLATFORM(IOS).
- Move uses of "PLATFORM(MAC) || PLATFORM(IOS)" to either a USE()/ENABLE() macro or some third PLATFORM() macro that is defined for both platforms.
What about doing this instead for the near term:
- Stop defining PLATFORM(MAC) when building for iOS.
- Add a new PLATFORM(IOS_MAC) macro for cases when the code works for both (with the understanding that we will want to use a different name later since we don't have a good name today).
- Replace "PLATFORM(MAC) || PLATFORM(IOS)" with "PLATFORM(IOS_MAC)".
- Replace "PLATFORM(MAC) && !PLATFORM(IOS)" with just "PLATFORM(MAC)".
Thoughts?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list