Mercurial > dwindows
changeset 1952:8ce5c562348f
Mac: Attempting a better WKWebKit fix, use the WK_API_ENABLED constant to determine if the API is available.
Apparently it is only available on intel 64bit regardless of the system version. Use the old API on 32bit
or older systems.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 11 Jul 2019 21:40:33 +0000 |
parents | e30164bc48fb |
children | 77d156c3f01c |
files | mac/dw.m |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Thu Jul 11 09:50:30 2019 +0000 +++ b/mac/dw.m Thu Jul 11 21:40:33 2019 +0000 @@ -151,10 +151,18 @@ */ #if defined(MAC_OS_X_VERSION_10_14) && ((defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14) || !defined(MAC_OS_X_VERSION_MAX_ALLOWED)) #define DWProgressIndicatorStyleBar NSProgressIndicatorStyleBar -#define DWWebView WKWebView #define BUILDING_FOR_MOJAVE #else #define DWProgressIndicatorStyleBar NSProgressIndicatorBarStyle +#endif + +/* Apparently the WKWebKit API is only enabled on intel 64bit... + * Causing build failures on 32bit builds, so this should allow + * WKWebKit on intel 64 and the old WebKit on intel 32 bit and earlier. + */ +#if WK_API_ENABLED +#define DWWebView WKWebView +#else #define DWWebView WebView #endif @@ -8279,7 +8287,7 @@ int API dw_html_raw(HWND handle, char *string) { DWWebView *html = handle; -#ifdef BUILDING_FOR_MOJAVE +#if WK_API_ENABLED [html loadHTMLString:[ NSString stringWithUTF8String:string ] baseURL:nil]; #else [[html mainFrame] loadHTMLString:[ NSString stringWithUTF8String:string ] baseURL:nil]; @@ -8299,7 +8307,7 @@ int API dw_html_url(HWND handle, char *url) { DWWebView *html = handle; -#ifdef BUILDING_FOR_MOJAVE +#if WK_API_ENABLED [html loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[ NSString stringWithUTF8String:url ]]]]; #else [[html mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[ NSString stringWithUTF8String:url ]]]];