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', 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) { diff --git a/webview/webview.h b/webview/webview.h index d1d2a1c..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; } } @@ -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);