[Webkit-unassigned] [Bug 107406] Collapse PLATFORM(MAC)||PLATFORM(IOS) to just PLATFORM(MAC)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 22 08:00:46 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=107406





--- Comment #8 from David Kilzer (:ddkilzer) <ddkilzer at webkit.org>  2013-01-22 08:02:36 PST ---
(In reply to comment #7)
> I tend to agree with Benjamin that while this patch does not make the situation a whole lot better at least it eliminates one of the ways to express "Mac or iOS". 

My concern remains that collapsing "PLATFORM(MAC) || PLATFORM(IOS)" into "PLATFORM(MAC)" leads to a loss of information (if only documentation that this code should be compiled for iOS) so that when we stop defining PLATFORM(MAC) when building for iOS, we now have to go back and re-audit any place that PLATFORM(IOS) was dropped.  There aren't many now, but there will be many more in the future.

What if we defined a multi-platform macro like this?

#define ANY_PLATFORM_3(WTF_FEATURE1, WTF_FEATURE2, WTF_FEATURE3) (PLATFORM(WTF_FEATURE1) || PLATFORM(WTF_FEATURE2) || PLATFORM(WTF_FEATURE3))
#define ANY_PLATFORM(WTF_FEATURE1, WTF_FEATURE2) (PLATFORM(WTF_FEATURE1) || PLATFORM(WTF_FEATURE2))
#define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE)

Then "PLATFORM(MAC) || PLATFORM(IOS)" would become "ANY_PLATFORM(IOS, MAC)".

And we could collapse actual logic like this in GraphicsContext3D.h:

#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY)

to something like this:

#if ANY_PLATFORM_5(BLACKBERRY, EFL, GTK, MAC, QT)

One (big?) downside to this is that it becomes much harder to search for all "PLATFORM(FOO)" macros using a purely text search.  Not sure how often that is done, though.

-- 
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