Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bcdddcb81ab8ec1fbfa7053c04696a681363d437
https://github.com/WebKit/WebKit/commit/bcdddcb81ab8ec1fbfa7053c04696a681363d437
Author: Basuke Suzuki <[email protected]>
Date: 2026-08-19 (Wed, 19 Aug 2026)
Changed paths:
M Source/WebCore/PAL/pal/cocoa/MediaToolboxSoftLink.h
M Source/WebCore/platform/graphics/cocoa/VideoTargetFactory.mm
Log Message:
-----------
[PAL] MediaToolboxSoftLink.h's
FigVideoTargetCreateWithVideoReceiverEndpointID macro breaks unified builds
https://bugs.webkit.org/show_bug.cgi?id=322110
rdar://185330340
Reviewed by Eric Carlson.
MediaToolboxSoftLink.h renamed the soft-linked function with a #define, and
that macro stays in
effect for the rest of the translation unit. When MediaToolbox's own
FigVideoTargetPrivate.h is
reached later in the same TU, the macro rewrites the identifier in its extern
"C" declaration,
so the function ends up declared with both C and C++ language linkage:
FigVideoTargetPrivate.h:205:1: error: declaration of
'softLink_MediaToolbox_FigVideoTargetCreateWithVideoReceiverEndpointID' has
a different
language linkage
Neither header reaches the other through a single include chain, so nothing
catches this until
unified sources put both in one TU. In Source/WebKit that pairing is
WebProcessPoolCocoa.mm,
which imports pal/cocoa/MediaToolboxSoftLink.h, with
GroupActivitiesCoordinator.mm, which
arrives at the SDK header through AVFoundationSoftLink.h, AVFoundationSPI.h,
AVPlayer_Private.h.
The tree builds today only because the current bundle layout happens to keep
those two files
apart. Adding any file to Source/WebKit/SourcesCocoa.txt ahead of them shifts
the packing along
by one and the build fails somewhere unrelated to the change. Adding
UIProcess/Cocoa/SecurityFlagsControllerCocoa.mm for bug 322074 is what surfaced
this, and that
file had to be marked @no-unify to get around it. The next person to add a file
under
UIProcess/Cocoa would hit the same wall.
Drop the #define and let the caller use the soft-link name. The function has
exactly one caller,
so nothing else has to change, and the identifier can no longer collide with
the SDK's
declaration.
No new tests. Verified by compiling a translation unit that imports
pal/cocoa/MediaToolboxSoftLink.h followed by pal/spi/cocoa/AVFoundationSPI.h,
which fails with
the error above before this change and compiles cleanly after it.
* Source/WebCore/PAL/pal/cocoa/MediaToolboxSoftLink.h:
* Source/WebCore/platform/graphics/cocoa/VideoTargetFactory.mm:
(WebCore::VideoTargetFactory::createTargetFromEndpoint):
Canonical link: https://commits.webkit.org/319480@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications