Bug 141849

Summary: Make namespace configurable for SOFT_LINK_*_{HEADER,SOURCE}() macros
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: WebCore Misc.Assignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, bfulgham, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 141625, 141816    
Attachments:
Description Flags
Patch v1 (for EWS builds)
none
Patch v2 (for EWS builds)
none
Patch v3 (for EWS builds)
none
Patch v4 (for landing; test EWS builds) bfulgham: review+

Description David Kilzer (:ddkilzer) 2015-02-20 12:31:14 PST
We should make the namespace configurable for SOFT_LINK_*_{HEADER,SOURCE}() macros.

And do a little clean-up at the same time, and some future support for Bug 141816.
Comment 1 David Kilzer (:ddkilzer) 2015-02-20 13:19:12 PST
Created attachment 246992 [details]
Patch v1 (for EWS builds)
Comment 2 WebKit Commit Bot 2015-02-20 13:20:50 PST
Attachment 246992 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/win/SoftLinking.h:206:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:316:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:329:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:334:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 David Kilzer (:ddkilzer) 2015-02-20 13:30:43 PST
Created attachment 246994 [details]
Patch v2 (for EWS builds)
Comment 4 WebKit Commit Bot 2015-02-20 13:32:50 PST
Attachment 246994 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/win/SoftLinking.h:206:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:316:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:329:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:334:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Brent Fulgham 2015-02-20 13:43:40 PST
Comment on attachment 246994 [details]
Patch v2 (for EWS builds)

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

This looks good, but I feel like making the SOFT_LINK_NAMESPACE an argument to SOFT_LINK_FRAMEWORK, etc., might be simpler. But it's fine as-is.

> Source/WebCore/platform/cf/CoreMediaSoftLink.cpp:36
> +SOFT_LINK_FRAMEWORK_SOURCE(CoreMedia)

Why not just make SOFT_LINK_NAMESPACE an argument to SOFT_LINK_FRAMEWORK_{SOURCE, HEADER}?
Comment 6 David Kilzer (:ddkilzer) 2015-02-20 13:46:47 PST
Created attachment 246996 [details]
Patch v3 (for EWS builds)
Comment 7 Brent Fulgham 2015-02-20 13:47:39 PST
Comment on attachment 246996 [details]
Patch v3 (for EWS builds)

Same comments as before. Looks fine!
Comment 8 WebKit Commit Bot 2015-02-20 13:49:14 PST
Attachment 246996 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/win/SoftLinking.h:197:  SOFT_LINK_NAMESPACE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/platform/win/SoftLinking.h:207:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:316:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:330:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:335:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 David Kilzer (:ddkilzer) 2015-02-20 13:54:22 PST
(In reply to comment #5)
> Comment on attachment 246994 [details]
> Patch v2 (for EWS builds)
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=246994&action=review
> 
> This looks good, but I feel like making the SOFT_LINK_NAMESPACE an argument
> to SOFT_LINK_FRAMEWORK, etc., might be simpler. But it's fine as-is.
> 
> > Source/WebCore/platform/cf/CoreMediaSoftLink.cpp:36
> > +SOFT_LINK_FRAMEWORK_SOURCE(CoreMedia)
> 
> Why not just make SOFT_LINK_NAMESPACE an argument to
> SOFT_LINK_FRAMEWORK_{SOURCE, HEADER}?

It seemed like too much duplication to add that to every single call site.

Let's chat in person, though!
Comment 10 David Kilzer (:ddkilzer) 2015-02-20 16:31:36 PST
(In reply to comment #9)
> (In reply to comment #5)
> > Comment on attachment 246994 [details]
> > Patch v2 (for EWS builds)
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=246994&action=review
> > 
> > This looks good, but I feel like making the SOFT_LINK_NAMESPACE an argument
> > to SOFT_LINK_FRAMEWORK, etc., might be simpler. But it's fine as-is.
> > 
> > > Source/WebCore/platform/cf/CoreMediaSoftLink.cpp:36
> > > +SOFT_LINK_FRAMEWORK_SOURCE(CoreMedia)
> > 
> > Why not just make SOFT_LINK_NAMESPACE an argument to
> > SOFT_LINK_FRAMEWORK_{SOURCE, HEADER}?
> 
> It seemed like too much duplication to add that to every single call site.
> 
> Let's chat in person, though!

I will go ahead and add an argument for the namespace for all the macros instead of doing the mysterious #define/#undefine of SOFT_LINK_NAMESPACE before landing.
Comment 11 David Kilzer (:ddkilzer) 2015-02-20 19:19:43 PST
Created attachment 247034 [details]
Patch v4 (for landing; test EWS builds)
Comment 12 WebKit Commit Bot 2015-02-20 19:21:10 PST
Attachment 247034 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/win/SoftLinking.h:205:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:315:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:328:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/mac/SoftLinking.h:333:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 Brent Fulgham 2015-02-20 19:41:50 PST
Comment on attachment 247034 [details]
Patch v4 (for landing; test EWS builds)

Looks great! r=me.
Comment 14 David Kilzer (:ddkilzer) 2015-02-20 20:09:35 PST
Committed r180476: <http://trac.webkit.org/changeset/180476>