From 3db4179cfab8827c5cc9b81440d27b24dff1b500 Mon Sep 17 00:00:00 2001 From: krister-ts <44512474+krister-ts@users.noreply.github.com> Date: Thu, 6 May 2021 16:21:51 -0700 Subject: [PATCH 1/4] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4084d94..4890b18 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def pkgconfig(flags): elif OSNAME == 'Windows': define_macros = [('WEBVIEW_WINAPI', '1')] extra_cflags = "" - extra_ldflags = ['-framework', 'CoreAudio'] + extra_ldflags = ['Advapi32.lib', 'Gdi32.lib'] webview = Extension( 'webview', From 6a9c8f36eec96bda68d9ee132731fefc772da2df Mon Sep 17 00:00:00 2001 From: krister-ts <44512474+krister-ts@users.noreply.github.com> Date: Thu, 6 May 2021 16:23:26 -0700 Subject: [PATCH 2/4] Update webview.h --- webview/webview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview/webview.h b/webview/webview.h index d1d2a1c..0ff6a1c 100644 --- a/webview/webview.h +++ b/webview/webview.h @@ -1338,7 +1338,7 @@ WEBVIEW_API int webview_eval(struct webview *w, const char *js) { arg.vt = VT_BSTR; static const char *prologue = "(function(){"; static const char *epilogue = ";})();"; - int n = strlen(prologue) + strlen(epilogue) + strlen(js) + 1; + size_t n = strlen(prologue) + strlen(epilogue) + strlen(js) + 1; char *eval = (char *)malloc(n); snprintf(eval, n, "%s%s%s", prologue, js, epilogue); wchar_t *buf = webview_to_utf16(eval); From ad22e483ebec97599c39f136ab63fdc8a9bc0ea1 Mon Sep 17 00:00:00 2001 From: krister-ts <44512474+krister-ts@users.noreply.github.com> Date: Thu, 6 May 2021 16:25:25 -0700 Subject: [PATCH 3/4] Update webview.c --- webview/webview.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webview/webview.c b/webview/webview.c index 8ae7244..fd464ac 100644 --- a/webview/webview.c +++ b/webview/webview.c @@ -5,6 +5,10 @@ #define WEBVIEW_IMPLEMENTATION #include "webview.h" +#ifndef PATH_MAX +#define PATH_MAX MAX_PATH +#endif + typedef struct { PyObject_HEAD struct webview w; } WebView; static void WebView_dealloc(WebView *self) { From 56bf64e320a8cd2c9a21b57b87c4a093af43864a Mon Sep 17 00:00:00 2001 From: krister-ts <44512474+krister-ts@users.noreply.github.com> Date: Thu, 6 May 2021 16:26:34 -0700 Subject: [PATCH 4/4] Update webview.h --- webview/webview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview/webview.h b/webview/webview.h index 0ff6a1c..c4ae85c 100644 --- a/webview/webview.h +++ b/webview/webview.h @@ -1085,7 +1085,7 @@ static int DisplayHTMLPage(struct webview *w) { for (const char *p = webview_url + strlen(WEBVIEW_DATA_URL_PREFIX); *q = *p; p++, q++) { if (*q == '%' && *(p + 1) && *(p + 2)) { - sscanf(p + 1, "%02x", q); + sscanf(p + 1, "%0hhx", q); p = p + 2; } }