diff --git a/vlib/builtin/builtin_windows.c.v b/vlib/builtin/builtin_windows.c.v index 6d34fa23af..0f0cd8165d 100644 --- a/vlib/builtin/builtin_windows.c.v +++ b/vlib/builtin/builtin_windows.c.v @@ -7,7 +7,25 @@ module builtin // g_original_codepage - used to restore the original windows console code page when exiting __global g_original_codepage = u32(0) -type C.BOOL = bool +pub type C.BOOL = bool + +pub struct C.HINSTANCE {} + +pub struct C.HICON {} + +pub struct C.HCURSOR {} + +pub struct C.HCURSOR {} + +pub struct C.HBRUSH {} + +pub struct C.HWND {} + +pub struct C.HGLOBAL {} + +pub struct C.HANDLE {} + +pub struct C.LRESULT {} // utf8 to stdout needs C.SetConsoleOutputCP(cp_utf8) fn C.GetConsoleOutputCP() u32 diff --git a/vlib/clipboard/clipboard_windows.c.v b/vlib/clipboard/clipboard_windows.c.v index 9eab9f62f9..44489250f8 100644 --- a/vlib/clipboard/clipboard_windows.c.v +++ b/vlib/clipboard/clipboard_windows.c.v @@ -110,7 +110,7 @@ fn new_clipboard() &Clipboard { // check_availability returns true if the clipboard is ready to be used. pub fn (cb &Clipboard) check_availability() bool { - return cb.hwnd != C.HWND(C.NULL) + return cb.hwnd != unsafe { nil } } // has_ownership returns true if the contents of @@ -143,7 +143,7 @@ fn to_wide(text string) C.HGLOBAL { len_required := C.MultiByteToWideChar(clipboard.cp_utf8, C.MB_ERR_INVALID_CHARS, text.str, text.len + 1, C.NULL, 0) buf := C.GlobalAlloc(C.GMEM_MOVEABLE, i64(sizeof(u16)) * len_required) - if buf != C.HGLOBAL(C.NULL) { + if buf != unsafe { nil } { mut locked := &u16(C.GlobalLock(buf)) C.MultiByteToWideChar(clipboard.cp_utf8, C.MB_ERR_INVALID_CHARS, text.str, text.len + 1, locked, len_required) @@ -166,7 +166,7 @@ pub fn (mut cb Clipboard) set_text(text string) bool { } else { // EmptyClipboard must be called to properly update clipboard ownership C.EmptyClipboard() - if C.SetClipboardData(C.CF_UNICODETEXT, buf) == C.HANDLE(C.NULL) { + if C.SetClipboardData(C.CF_UNICODETEXT, buf) == unsafe { nil } { println('SetClipboardData: Failed.') C.CloseClipboard() C.GlobalFree(buf) @@ -187,7 +187,7 @@ pub fn (mut cb Clipboard) get_text() string { return '' } h_data := C.GetClipboardData(C.CF_UNICODETEXT) - if h_data == C.HANDLE(C.NULL) { + if h_data == unsafe { nil } { C.CloseClipboard() return '' } diff --git a/vlib/net/http/backend_windows.c.v b/vlib/net/http/backend_windows.c.v index c938bdfc7c..5a758bb0cc 100644 --- a/vlib/net/http/backend_windows.c.v +++ b/vlib/net/http/backend_windows.c.v @@ -11,6 +11,8 @@ $if gcboehm ? { #flag -l ws2_32 -l crypt32 -l secur32 -l user32 #include "vschannel.c" +struct C.TlsContext {} + fn C.new_tls_context() C.TlsContext fn (req &Request) ssl_do(port int, method Method, host_name string, path string) !Response {