Bug 221834 - enum LengthType -> enum class LengthType
Summary: enum LengthType -> enum class LengthType
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks: 221744
  Show dependency treegraph
 
Reported: 2021-02-12 11:36 PST by Myles C. Maxfield
Modified: 2021-02-12 13:51 PST (History)
25 users (show)

See Also:


Attachments
Patch (176.14 KB, patch)
2021-02-12 11:47 PST, Myles C. Maxfield
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (188.05 KB, patch)
2021-02-12 12:14 PST, Myles C. Maxfield
simon.fraser: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for committing (191.31 KB, patch)
2021-02-12 12:25 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2021-02-12 11:36:51 PST
enum LengthType -> enum class LengthType
Comment 1 Myles C. Maxfield 2021-02-12 11:47:37 PST
Created attachment 420158 [details]
Patch
Comment 2 Sam Weinig 2021-02-12 11:59:36 PST
Comment on attachment 420158 [details]
Patch

rs=me, but get it compiling.
Comment 3 Myles C. Maxfield 2021-02-12 12:14:57 PST
Created attachment 420160 [details]
Patch
Comment 4 Myles C. Maxfield 2021-02-12 12:25:47 PST
Created attachment 420164 [details]
Patch for committing
Comment 5 EWS 2021-02-12 13:31:47 PST
Committed r272805: <https://commits.webkit.org/r272805>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 420164 [details].
Comment 6 Radar WebKit Bug Importer 2021-02-12 13:32:25 PST
<rdar://problem/74289873>
Comment 7 Darin Adler 2021-02-12 13:51:32 PST
Comment on attachment 420164 [details]
Patch for committing

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

> Source/WebCore/ChangeLog:24
> +        iPhoneOS14.2.sdk/usr/include/MacTypes.h:193 has:
> +
> +        typedef SInt32 Fixed;
> +
> +        but we have:
> +
> +        enum LengthType {
> +            ... Fixed ...
> +        }
> +
> +        This leads to: error: reference to 'Fixed' is ambiguous
> +
> +        Unfortunately, this error occurs in
> +        /System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h,
> +        which means we can't modify the error site to qualify the name. Therefore,
> +        the best solution is to turn enum LengthType into enum class LengthType.
> +        This is in accordance with WebKit's style guide.

This is only an issue if someone does:

    using namespace WebCore;

Then later includes SFNTLayoutTypes.h.

While this big enum class change is fine, another fix would be to reduce use of "using namespace WebCore" or technically to find the *incorrect* use of it, because it’s not correct to include a system framework after that.