# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1562881233 0 # Node ID 8ce5c562348f9b1268083a9372f8a98a7ba8fcbe # Parent e30164bc48fb7257ab7787d507f32691ca802e28 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. diff -r e30164bc48fb -r 8ce5c562348f mac/dw.m --- 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 ]]]];