Bug 101780

Summary: objc/objc-runtime.h does not exist on all PLATFORM(MAC)
Product: WebKit Reporter: Jeremy Wyld <jeremy_wyld>
Component: Web Template FrameworkAssignee: Pratik Solanki <psolanki>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, benjamin, eric.carlson, feature-media-reviews, joepeck, ojan, psolanki, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Other   
Attachments:
Description Flags
Patch bfulgham: review+

Description Jeremy Wyld 2012-11-09 11:42:26 PST
objc/objc-runtime.h does not exist on iOS.  In fact on OSX, the entire contents of this include is

#include <objc/runtime.h>
#include <objc/message.h>

In order to build for iOS, one must either alter the installed SDK or alter wtf/Functional.h.  Altering the SDK is incorrect.

Here's a diff from Safari-536.26 branch:
diff --git a/Source/WTF/wtf/Functional.h b/Source/WTF/wtf/Functional.h
index 48d9f32..ffff2d4 100644
--- a/Source/WTF/wtf/Functional.h
+++ b/Source/WTF/wtf/Functional.h
@@ -33,7 +33,8 @@
 
 #if PLATFORM(MAC) && COMPILER_SUPPORTS(BLOCKS)
 #include <Block.h>
-#include <objc/objc-runtime.h>
+#import <objc/runtime.h>
+#include <objc/message.h>
 #endif
 
 namespace WTF {
Comment 1 Pratik Solanki 2012-11-09 14:25:16 PST
Looks like a reasonable change, but why #import for one and #include for the other?
Comment 2 Pratik Solanki 2012-11-09 14:29:42 PST
And if you want to do this, then lets replace all uses of objc-runtime.h with either one or both of the other two headers.
Comment 3 Anders Carlsson 2012-11-09 15:55:16 PST
(In reply to comment #2)
> And if you want to do this, then lets replace all uses of objc-runtime.h with either one or both of the other two headers.

Sounds reasonable.
Comment 4 Pratik Solanki 2012-11-09 17:02:01 PST
Someone want to create a patch? Jeremy?
Comment 5 Pratik Solanki 2012-11-26 16:01:52 PST
Created attachment 176101 [details]
Patch
Comment 6 Brent Fulgham 2012-11-26 17:40:49 PST
Comment on attachment 176101 [details]
Patch

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

Looks good to me.  The mac EWS hasn't completed, but I assume you probably already did the Apple Mac and iOS builds locally.

> Source/WebKit/mac/Carbon/HIWebView.mm:1169
> +                        if (wtfObjcMsgSend<BOOL>(resp, @selector(validateUserInterfaceItem:), proxy))

Cool!  I didn't know about this template.
Comment 7 Pratik Solanki 2012-11-26 17:43:37 PST
(In reply to comment #6)
> (From update of attachment 176101 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176101&action=review
> 
> Looks good to me.  The mac EWS hasn't completed, but I assume you probably already did the Apple Mac and iOS builds locally.

I'll wait for the EWS to complete. I just did the Mac build locally on MountainLion. It's possible older OSes might break but the fix for such breakage should be easy enough. Thanks for the review.
Comment 8 Pratik Solanki 2012-11-27 10:39:25 PST
Mac EWS seems broken. I'll land this patch shortly (with slightly updated ChangeLogs).
Comment 9 Pratik Solanki 2012-11-27 10:59:41 PST
Committed r135882: <http://trac.webkit.org/changeset/135882>