Bug 88517

Summary: [WebKit2] Only include Cocoa.h on platforms that use AppKit
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Andy Estes 2012-06-07 03:14:14 PDT
[WebKit2] Only include Cocoa.h on platforms that use AppKit
Comment 1 Andy Estes 2012-06-07 03:19:30 PDT
Created attachment 146243 [details]
Patch
Comment 2 Gustavo Noronha (kov) 2012-06-07 07:39:52 PDT
Comment on attachment 146243 [details]
Patch

Attachment 146243 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12906969
Comment 3 Andy Estes 2012-06-07 18:16:35 PDT
Oh weird. Could this be due to me trying to include Platform.h in WebKit2Prefix.h without first including autotoolsconfig.h? Is that a requirement on GTK?
Comment 4 Andy Estes 2012-06-07 18:25:57 PDT
I think I can probably just remove the include of Cocoa.h from WebKit2Prefix.h since it's already in config.h.
Comment 5 Andy Estes 2012-06-07 18:36:01 PDT
(In reply to comment #4)
> I think I can probably just remove the include of Cocoa.h from WebKit2Prefix.h since it's already in config.h.

No, turns out that including Cocoa.h is required so that our #defines for new and delete in WebKit2Prefix.h don't end up expanding +[NSObject new] and -[NSText delete:]. I'll just try including autotoolsconfig.h.
Comment 6 Andy Estes 2012-06-07 18:39:56 PDT
Created attachment 146444 [details]
Patch
Comment 7 Andy Estes 2012-06-07 18:44:08 PDT
Comment on attachment 146444 [details]
Patch

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

> Source/WebKit2/config.h:84
>  #ifdef __OBJC__
> +#import <Foundation/Foundation.h>
> +#if USE(APPKIT)
>  #import <Cocoa/Cocoa.h>
>  #endif
> +#endif

Actually, there's no reason for this entire block since it's already in the prefix header.
Comment 8 Andy Estes 2012-06-07 18:50:52 PDT
Created attachment 146449 [details]
Patch
Comment 9 WebKit Review Bot 2012-06-07 21:49:52 PDT
Comment on attachment 146449 [details]
Patch

Clearing flags on attachment: 146449

Committed r119798: <http://trac.webkit.org/changeset/119798>
Comment 10 WebKit Review Bot 2012-06-07 21:49:57 PDT
All reviewed patches have been landed.  Closing bug.