[Webkit-unassigned] [Bug 166047] Macro expansion producing 'defined' has undefined behavior

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 20 15:21:17 PST 2016


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

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #297554|review?                     |review+
              Flags|                            |

--- Comment #6 from Darin Adler <darin at apple.com> ---
Comment on attachment 297554
  --> https://bugs.webkit.org/attachment.cgi?id=297554
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=297554&action=review

Looks good to me.

> Source/WebKit2/Shared/API/Cocoa/WKFoundation.h:34
>  #if TARGET_OS_IPHONE
>  #define WK_API_ENABLED 1
>  #else
> -#define WK_API_ENABLED (defined(__clang__) && defined(__APPLE__) && !defined(__i386__))
> +#if (defined(__clang__) && defined(__APPLE__) && !defined(__i386__))
> +#define WK_API_ENABLED 1

This seems a bit inelegant. I would write:

    #if TARGET_OS_IPHONE || (defined(__clang__) && defined(__APPLE__) && !defined(__i386__))
    <...>
    #endif

Rather than #if #else #if #else.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161220/0cf32255/attachment.html>


More information about the webkit-unassigned mailing list