Bug 54168

Summary: Move WTF_USE_CFNETWORK to Platform.h
Product: WebKit Reporter: Pratik Solanki <psolanki>
Component: WebCore Misc.Assignee: Pratik Solanki <psolanki>
Status: RESOLVED FIXED    
Severity: Normal CC: ddkilzer, psolanki
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 51836    
Attachments:
Description Flags
Patch
none
Patch darin: review+

Description Pratik Solanki 2011-02-09 22:29:05 PST
WTF_USE_CFNETWORK is defined in WebCore/config.h. It should be defined in Platform.h which will make it easier to have #if USE(CFNETWORK) blocks in WebKit.
Comment 1 Pratik Solanki 2011-02-09 22:38:08 PST
Created attachment 81925 [details]
Patch

Patch attached. Though I will wait for the Windows EWS to build it before checking it in.
Comment 2 David Kilzer (:ddkilzer) 2011-02-15 14:13:58 PST
Comment on attachment 81925 [details]
Patch

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

r=me with the fix to provide a default for WTF_USE_CFNETWORK.

> Source/JavaScriptCore/wtf/Platform.h:684
> +#define WTF_USE_CFNETWORK 1

You need to add a section closer to the end of Platform.h that provides a default:

#if !defined(WTF_USE_CFNETWORK)
#define WTF_USE_CFNETWORK 0
#endif

You might want to move it close to this line just for proximity's sake:

/* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
#define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
Comment 3 Pratik Solanki 2011-02-15 14:35:04 PST
Created attachment 82520 [details]
Patch
Comment 4 Darin Adler 2011-02-15 14:35:42 PST
Comment on attachment 81925 [details]
Patch

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

>> Source/JavaScriptCore/wtf/Platform.h:684
>> +#define WTF_USE_CFNETWORK 1
> 
> You need to add a section closer to the end of Platform.h that provides a default:
> 
> #if !defined(WTF_USE_CFNETWORK)
> #define WTF_USE_CFNETWORK 0
> #endif
> 
> You might want to move it close to this line just for proximity's sake:
> 
> /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
> #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK

I don’t think that’s right about needing a default. The USE macro checks for a symbol that’s not defined, so why would we need to define it as 0?
Comment 5 Darin Adler 2011-02-15 14:36:09 PST
Comment on attachment 82520 [details]
Patch

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

> Source/JavaScriptCore/wtf/Platform.h:1136
> +#if !defined(WTF_USE_CFNETWORK)
> +#define WTF_USE_CFNETWORK 0
> +#endif

I know Dave Kilzer told you this is needed, but I don’t think it is.
Comment 6 David Kilzer (:ddkilzer) 2011-02-15 14:38:41 PST
(In reply to comment #5)
> (From update of attachment 82520 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=82520&action=review
> 
> > Source/JavaScriptCore/wtf/Platform.h:1136
> > +#if !defined(WTF_USE_CFNETWORK)
> > +#define WTF_USE_CFNETWORK 0
> > +#endif
> 
> I know Dave Kilzer told you this is needed, but I don’t think it is.

I see, we only need this when the default is to enable.  Okay.
Comment 7 Pratik Solanki 2011-02-15 15:02:25 PST
Committed r78622: <http://trac.webkit.org/changeset/78622>