Summary: | libwebrtc.dylib Objective-C classes conflict with third-party frameworks | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
Component: | WebRTC | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | achristensen, commit-queue, eric.carlson, ggaren, jer.noble, mitz, webkit-bug-importer, youennf | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2018-07-13 12:12:11 PDT
Here are the commands I used to add the attributes: $ perl -pi -e 's/^(\@interface (RTC[^\s<;:]*)[^\(\)]*)$/__attribute__((objc_runtime_name("WK_$2")))\n$1/mg' `egrep -l -r '^@interface RTC' Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v UnitTests` $ perl -pi -e 's/^\@protocol (RTC[^\s<;:]*)/__attribute__((objc_runtime_name("WK_$1")))\n\@protocol $1/mg' `egrep -l -r '^@protocol RTC' Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v UnitTests` Note that the easiest way (when merging upstream changes) to update this is probably to remove these attributes, merge the update, then rerun the commands above. We may also want to consider upstreaming a change that lets anyone define their own prefix for Objective-C classes and protocols to make this easier. For now, we're doing the simplest thing possible by using the attributes directly (as I didn't want to introduce a header file that must be included in many other header files). Created attachment 344967 [details]
Patch v1
(In reply to David Kilzer (:ddkilzer) from comment #1) > Here are the commands I used to add the attributes: > > $ perl -pi -e 's/^(\@interface > (RTC[^\s<;:]*)[^\(\)]*)$/__attribute__((objc_runtime_name("WK_$2")))\n$1/mg' > `egrep -l -r '^@interface RTC' > Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v > UnitTests` > > $ perl -pi -e 's/^\@protocol > (RTC[^\s<;:]*)/__attribute__((objc_runtime_name("WK_$1")))\n\@protocol > $1/mg' `egrep -l -r '^@protocol RTC' > Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework | grep -v > UnitTests` I should note that this is the only source file that's NOT covered by the commands above: Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm Comment on attachment 344967 [details] Patch v1 Clearing flags on attachment: 344967 Committed r233812: <https://trac.webkit.org/changeset/233812> All reviewed patches have been landed. Closing bug. |