<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <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&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=255295&amp;action=diff" name="attach_255295" title="Patch">attachment 255295</a> <a href="attachment.cgi?id=255295&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=255295&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=255295&amp;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">&gt; Source/WebCore/platform/graphics/PlatformDisplay.cpp:51
&gt;  #if PLATFORM(GTK)
&gt; +#include &lt;gdk/gdk.h&gt;
&gt; +#endif
&gt; +
&gt; +#if PLATFORM(GTK)
&gt;  #if PLATFORM(X11)
&gt;  #include &lt;gdk/gdkx.h&gt;
&gt;  #endif</span >

Rather than nesting, I prefer to write each condition out separately. It would look like this:

#if PLATFORM(GTK)
#include &lt;gdk/gk.h&gt;
#endif

#if PLATFORM(GTK) &amp;&amp; PLATFORM(X11)
#include &lt;gdk/gdkx.h&gt;
#endif

#if PLATFORM(GTK) &amp;&amp; PLATFORM(WAYLAND) &amp;&amp; !defined(GTK_API_VERSION_2)
#include &lt;gdk/gdkwayland.h&gt;
#endif

This is more tidy than the nested way of writing it, especially with all the &quot;#endif // PLATFORM(GTK)&quot; gunk.

<span class="quote">&gt; Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp:46
&gt; -#if OS(DARWIN)
&gt; +#if PLATFORM(COCOA)
&gt;  const FourCharCode MATHTag = 'MATH';
&gt;  #else
&gt;  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">&gt; Source/WebKit2/Platform/IPC/Attachment.cpp:39
&gt; -#if OS(DARWIN)
&gt; +#if PLATFORM(COCOA)</span >

This is wrong. It should match the header and say:

#if OS(DARWIN) &amp;&amp; !USE(UNIX_DOMAIN_SOCKETS)

<span class="quote">&gt; Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp:61
&gt; -#if OS(DARWIN)
&gt; +#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">&gt; Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h:64
&gt; +#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>