1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

force C function definitions

This commit is contained in:
Alexander Medvednikov
2019-11-24 06:27:02 +03:00
parent 1f93bb5a9a
commit e9e931fe4a
22 changed files with 227 additions and 84 deletions

View File

@@ -1026,3 +1026,8 @@ pub fn tmpdir() string {
}
return path
}
pub fn chmod(path string, mode int) {
C.chmod(path.str, mode)
}

View File

@@ -18,11 +18,11 @@ pub fn init_os_args(argc int, argv &byteptr) []string {
// get_error_msg return error code representation in string.
pub fn get_error_msg(code int) string {
_ptr_text := C.strerror(code) // voidptr?
if _ptr_text == 0 {
ptr_text := C.strerror(code) // voidptr?
if ptr_text == 0 {
return ''
}
return tos(_ptr_text, vstrlen(_ptr_text))
return tos3(ptr_text)
}
pub fn ls(path string) ?[]string {