RESOLVED FIXED 107360
Remove unnecessary PLATFORM() tests
https://bugs.webkit.org/show_bug.cgi?id=107360
Summary Remove unnecessary PLATFORM() tests
Laszlo Gombos
Reported 2013-01-18 22:56:05 PST
PLATFORM(WIN) PLATFORM(CHROMIUM) and PLATFORM(QT) are mutually exclusive - only one of them can be true. In a few places we have tests like "PLATFORM(WIN) && !PLATFORM(CHROMIUM) && !PLATFORM(QT)". This is probably a left over from the times when PLATFORM(WIN) use to be OS(WIN).
Attachments
proposed change (1.48 KB, patch)
2013-01-18 22:59 PST, Laszlo Gombos
no flags
Laszlo Gombos
Comment 1 2013-01-18 22:59:54 PST
Created attachment 183605 [details] proposed change
Eric Seidel (no email)
Comment 2 2013-01-18 23:01:43 PST
Comment on attachment 183605 [details] proposed change Because PLATFORM(WIN) means AppleWin?
Laszlo Gombos
Comment 3 2013-01-18 23:08:10 PST
(In reply to comment #2) > (From update of attachment 183605 [details]) > Because PLATFORM(WIN) means AppleWin? Yes, indeed.
Laszlo Gombos
Comment 4 2013-01-18 23:09:49 PST
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 183605 [details] [details]) > > Because PLATFORM(WIN) means AppleWin? > > Yes, indeed. These PLATFORM() macros are setup in Platform.h and from the definition it is clear that there are mutually exclusive. #if defined(BUILDING_CHROMIUM__) #define WTF_PLATFORM_CHROMIUM 1 #elif defined(BUILDING_QT__) #define WTF_PLATFORM_QT 1 #elif defined(BUILDING_WX__) #define WTF_PLATFORM_WX 1 #elif defined(BUILDING_EFL__) #define WTF_PLATFORM_EFL 1 #elif defined(BUILDING_GTK__) #define WTF_PLATFORM_GTK 1 #elif defined(BUILDING_BLACKBERRY__) #define WTF_PLATFORM_BLACKBERRY 1 #elif OS(DARWIN) #define WTF_PLATFORM_MAC 1 #elif OS(WINDOWS) #define WTF_PLATFORM_WIN 1 #endif
Eric Seidel (no email)
Comment 5 2013-01-18 23:15:55 PST
Comment on attachment 183605 [details] proposed change OK. One of these years we should rename PLATFORM(MAC) and PLATFORM(WIN) to PLATFORM(APPLE_MAC) and APPLE_WIN to end the confusion.
WebKit Review Bot
Comment 6 2013-01-18 23:50:10 PST
Comment on attachment 183605 [details] proposed change Clearing flags on attachment: 183605 Committed r140238: <http://trac.webkit.org/changeset/140238>
WebKit Review Bot
Comment 7 2013-01-18 23:50:14 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 8 2013-01-19 08:30:30 PST
(In reply to comment #5) > OK. One of these years we should rename PLATFORM(MAC) and PLATFORM(WIN) to PLATFORM(APPLE_MAC) and APPLE_WIN to end the confusion. Renaming is fine, but even though they seem different to you, I don’t think that most people would understand APPLE_MAC as distinct from MAC, so I think we have to think more on how to name.
Note You need to log in before you can comment on or make changes to this bug.