Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions webview/webview.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions webview/webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand Down