mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin,os: fix compiling V programs with latest clang 16 on windows (clang 16 is stricter than clang 14) (#19095)
This commit is contained in:
parent
64029a2980
commit
eef9b5f168
@ -286,8 +286,7 @@ pub fn winapi_lasterr_str() string {
|
||||
}
|
||||
mut msgbuf := &u16(0)
|
||||
res := C.FormatMessage(C.FORMAT_MESSAGE_ALLOCATE_BUFFER | C.FORMAT_MESSAGE_FROM_SYSTEM | C.FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
C.NULL, err_msg_id, C.MAKELANGID(C.LANG_NEUTRAL, C.SUBLANG_DEFAULT), &msgbuf,
|
||||
0, C.NULL)
|
||||
0, err_msg_id, 0, voidptr(&msgbuf), 0, 0)
|
||||
err_msg := if res == 0 {
|
||||
'Win-API error ${err_msg_id}'
|
||||
} else {
|
||||
|
@ -349,7 +349,7 @@ fn C.FindClose(hFindFile voidptr)
|
||||
// macro
|
||||
fn C.MAKELANGID(lgid voidptr, srtid voidptr) int
|
||||
|
||||
fn C.FormatMessage(dwFlags u32, lpSource voidptr, dwMessageId u32, dwLanguageId u32, lpBuffer voidptr, nSize int, arguments ...voidptr) voidptr
|
||||
fn C.FormatMessage(dwFlags u32, lpSource voidptr, dwMessageId u32, dwLanguageId u32, lpBuffer voidptr, nSize u32, arguments ...voidptr) u32
|
||||
|
||||
fn C.CloseHandle(voidptr) int
|
||||
|
||||
|
@ -262,8 +262,7 @@ fn ptr_win_get_error_msg(code u32) voidptr {
|
||||
return buf
|
||||
}
|
||||
C.FormatMessage(os.format_message_allocate_buffer | os.format_message_from_system | os.format_message_ignore_inserts,
|
||||
0, code, C.MAKELANGID(os.lang_neutral, os.sublang_default), voidptr(&buf), 0,
|
||||
0)
|
||||
0, code, 0, voidptr(&buf), 0, 0)
|
||||
return buf
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user