<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Fix combinations of PLATFORM(GTK) and OS(DARWIN)"
href="https://bugs.webkit.org/show_bug.cgi?id=144560">bug 144560</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #255295 Flags</td>
<td>review?, commit-queue?
</td>
<td>review+, commit-queue-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Fix combinations of PLATFORM(GTK) and OS(DARWIN)"
href="https://bugs.webkit.org/show_bug.cgi?id=144560#c21">Comment # 21</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Fix combinations of PLATFORM(GTK) and OS(DARWIN)"
href="https://bugs.webkit.org/show_bug.cgi?id=144560">bug 144560</a>
from <span class="vcard"><a class="email" href="mailto:darin@apple.com" title="Darin Adler <darin@apple.com>"> <span class="fn">Darin Adler</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=255295&action=diff" name="attach_255295" title="Patch">attachment 255295</a> <a href="attachment.cgi?id=255295&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=255295&action=review">https://bugs.webkit.org/attachment.cgi?id=255295&action=review</a>
For the long term health of our configuration macros: Use of PLATFORM(XXX) is to be minimized. PLATFORM(COCOA) for low level stuff is particularly bad.
<span class="quote">> Source/WebCore/platform/graphics/PlatformDisplay.cpp:51
> #if PLATFORM(GTK)
> +#include <gdk/gdk.h>
> +#endif
> +
> +#if PLATFORM(GTK)
> #if PLATFORM(X11)
> #include <gdk/gdkx.h>
> #endif</span >
Rather than nesting, I prefer to write each condition out separately. It would look like this:
#if PLATFORM(GTK)
#include <gdk/gk.h>
#endif
#if PLATFORM(GTK) && PLATFORM(X11)
#include <gdk/gdkx.h>
#endif
#if PLATFORM(GTK) && PLATFORM(WAYLAND) && !defined(GTK_API_VERSION_2)
#include <gdk/gdkwayland.h>
#endif
This is more tidy than the nested way of writing it, especially with all the "#endif // PLATFORM(GTK)" gunk.
<span class="quote">> Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp:46
> -#if OS(DARWIN)
> +#if PLATFORM(COCOA)
> const FourCharCode MATHTag = 'MATH';
> #else
> const uint32_t MATHTag = OT_MAKE_TAG('M', 'A', 'T', 'H');</span >
I don’t know why we need this special case for PLATFORM(COCOA); can’t we always use OT_MAKE_TAG?
<span class="quote">> Source/WebKit2/Platform/IPC/Attachment.cpp:39
> -#if OS(DARWIN)
> +#if PLATFORM(COCOA)</span >
This is wrong. It should match the header and say:
#if OS(DARWIN) && !USE(UNIX_DOMAIN_SOCKETS)
<span class="quote">> Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp:61
> -#if OS(DARWIN)
> +#if PLATFORM(COCOA)</span >
This doesn’t seem quite right to me, but I can’t come up with anything better. PLATFORM(COCOA) is a really high level concept and it not the right conditional for “use Mach directly”.
<span class="quote">> Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h:64
> +#if PLATFORM(COCOA)</span >
Ditto.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>