Skip to content

Commit

Permalink
Cherry-pick 9809c1a. rdar://problem/113360320
Browse files Browse the repository at this point in the history
    SHA1.h doesn't parse after recent SDK changes
    https://bugs.webkit.org/show_bug.cgi?id=259800
    rdar://113360320

    Reviewed by Megan Gardner and Wenson Hsieh.

    * Source/WTF/wtf/SHA1.h:
    Recent SDK changes resulted in CoreUtils headers getting imported into
    translation units (MediaPlayerPrivateWebM.mm) that also import `SHA1.h`.

    The aforementioned CoreUtils headers have long had a macro SHA1(),
    which conflict with our template functions' definitions, and make SHA1.h
    fail to parse.

    As a quick workaround, undefine the rogue macros before our SHA1 class.

    Canonical link: https://commits.webkit.org/266559@main

Canonical link: https://commits.webkit.org/265870.291@safari-7616.1.27.12-branch
  • Loading branch information
hortont424 authored and rjepstein committed Aug 4, 2023
1 parent 71b60c1 commit ad8ed2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/WTF/wtf/SHA1.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
#include <CommonCrypto/CommonDigest.h>
#endif

// On Cocoa platforms, CoreUtils.h has a SHA1() macro that sometimes get included above here.
#ifdef SHA1
#undef SHA1
#endif

namespace WTF {

class SHA1 {
Expand Down

0 comments on commit ad8ed2f

Please sign in to comment.