# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1561149728 0 # Node ID 83148aaa35a5c34cb3ad024e4169a1709118568d # Parent 5a88fff43d993edce1c403e72c14488a61d04a46 Mac: Fixed building on Sierra, WKWebKit is undefined even though the docs say it should be supported on 10.10+. diff -r 5a88fff43d99 -r 83148aaa35a5 mac/dw.m --- a/mac/dw.m Fri Jun 21 19:37:57 2019 +0000 +++ b/mac/dw.m Fri Jun 21 20:42:08 2019 +0000 @@ -52,6 +52,13 @@ localpool = [[NSAutoreleasePool alloc] init]; #define DW_LOCAL_POOL_OUT if(localpool) [localpool drain]; +/* For some reason WKWebView is undefined on some versions that supposed to support it */ +#ifdef WKWebView +#define DWWebView WKWebView +#else +#define DWWebView WebView +#endif + /* Handle deprecation of several constants in 10.10... * the replacements are not available in earlier versions. */ @@ -59,13 +66,11 @@ #define DWModalResponseOK NSModalResponseOK #define DWModalResponseCancel NSModalResponseCancel #define DWPaperOrientationPortrait NSPaperOrientationPortrait -#define DWWebView WKWebView #define BUILDING_FOR_YOSEMITE #else #define DWModalResponseOK NSOKButton #define DWModalResponseCancel NSCancelButton #define DWPaperOrientationPortrait NSPortraitOrientation -#define DWWebView WebView #endif /* Handle deprecation of several constants in 10.12... @@ -8181,7 +8186,7 @@ int API dw_html_raw(HWND handle, char *string) { DWWebView *html = handle; -#ifdef BUILDING_FOR_YOSEMITE +#ifdef WKWebKit [html loadHTMLString:[ NSString stringWithUTF8String:string ] baseURL:nil]; #else [[html mainFrame] loadHTMLString:[ NSString stringWithUTF8String:string ] baseURL:nil]; @@ -8201,7 +8206,7 @@ int API dw_html_url(HWND handle, char *url) { DWWebView *html = handle; -#ifdef BUILDING_FOR_YOSEMITE +#ifdef WKWebKit [html loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[ NSString stringWithUTF8String:url ]]]]; #else [[html mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[ NSString stringWithUTF8String:url ]]]];