Fix compilation of WebView code in wxOSX with SDK < 10.11

This was broken by 05857e66c0 which introduced
dependencies on protocols only declared in 10.11 headers.

Fix build by checking if we're using 10.11 SDK and using these protocols only
in this case.
This commit is contained in:
Vadim Zeitlin
2016-11-26 17:29:27 +01:00
parent 50190395c6
commit 295576f78f
2 changed files with 18 additions and 6 deletions

View File

@@ -28,6 +28,12 @@
#define DEBUG_WEBKIT_SIZING 0
#if defined(MAC_OS_X_VERSION_10_11) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11)
#define wxWEBKIT_PROTOCOL_SINCE_10_11(proto) < proto >
#else
#define wxWEBKIT_PROTOCOL_SINCE_10_11(proto)
#endif
extern WXDLLEXPORT_DATA(const char) wxWebKitCtrlNameStr[] = "webkitctrl";
// ----------------------------------------------------------------------------
@@ -130,7 +136,7 @@ inline int wxNavTypeFromWebNavType(int type){
return wxWEBKIT_NAV_OTHER;
}
@interface MyFrameLoadMonitor : NSObject <WebFrameLoadDelegate>
@interface MyFrameLoadMonitor : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebFrameLoadDelegate)
{
wxWebKitCtrl* webKitWindow;
}
@@ -139,7 +145,7 @@ inline int wxNavTypeFromWebNavType(int type){
@end
@interface MyPolicyDelegate : NSObject <WebPolicyDelegate>
@interface MyPolicyDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebPolicyDelegate)
{
wxWebKitCtrl* webKitWindow;
}
@@ -148,7 +154,7 @@ inline int wxNavTypeFromWebNavType(int type){
@end
@interface MyUIDelegate : NSObject <WebUIDelegate>
@interface MyUIDelegate : NSObject wxWEBKIT_PROTOCOL_SINCE_10_11(WebUIDelegate)
{
wxWebKitCtrl* webKitWindow;
}