Bug 101780 - objc/objc-runtime.h does not exist on all PLATFORM(MAC)
Summary: objc/objc-runtime.h does not exist on all PLATFORM(MAC)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac Other
: P2 Normal
Assignee: Pratik Solanki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-09 11:42 PST by Jeremy Wyld
Modified: 2012-11-27 10:59 PST (History)
8 users (show)

See Also:


Attachments
Patch (21.84 KB, patch)
2012-11-26 16:01 PST, Pratik Solanki
bfulgham: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>