Bug 164684 - USE(APPLE_INTERNAL_SDK) should not be combined with other conditions
Summary: USE(APPLE_INTERNAL_SDK) should not be combined with other conditions
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-12 11:55 PST by mitz
Modified: 2017-11-03 08:08 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2016-11-12 11:55:27 PST
There are some instances of
    #if USE(APPLE_INTERNAL_SDK) && …
in the code base, but this is hardly ever the right thing to do. USE(APPLE_INTERNAL_SDK) really only makes sense as the innermost condition, and almost always has an #else clause that should not depend on anything other than the use of the internal SDK (but should just contain declarations that are equivalent to what the SDK provides).
Comment 1 mitz 2016-11-12 12:39:49 PST
I see that a common pattern is
    USE(APPLE_INTERNAL_SDK) || PLATFORM(MAC)
because several APIs are public in macOS but private in iOS and Windows.
Comment 2 Frédéric Wang (:fredw) 2017-11-03 08:08:24 PDT
(In reply to mitz from comment #0)
> There are some instances of
>     #if USE(APPLE_INTERNAL_SDK) && …
> in the code base, but this is hardly ever the right thing to do.
> USE(APPLE_INTERNAL_SDK) really only makes sense as the innermost condition,
> and almost always has an #else clause that should not depend on anything
> other than the use of the internal SDK (but should just contain declarations
> that are equivalent to what the SDK provides).

Also, we should consider moving such #if #else into separate SPI.h headers.

Note: I just rebased and landed the old patch https://trac.webkit.org/changeset/224395 which adds more USE(APPLE_INTERNAL_SDK) to fix here.