Merge branch 'master' into new-io

This commit is contained in:
gingerBill
2023-06-14 12:07:04 +01:00
25 changed files with 207 additions and 130 deletions
+1 -4
View File
@@ -44,9 +44,6 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
if !hosts_ok {
return nil, .Invalid_Hosts_Config_Error
}
if len(hosts) == 0 {
return
}
host_overrides := make([dynamic]DNS_Record)
for host in hosts {
@@ -80,4 +77,4 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
}
return get_dns_records_from_nameservers(hostname, type, name_servers, host_overrides[:])
}
}
+1 -1
View File
@@ -294,7 +294,7 @@ _read :: proc(f: ^File, p: []byte) -> (n: int, err: Error) {
}
}
return int(total_read), nil
return int(total_read), err
}
_read_at :: proc(f: ^File, p: []byte, offset: i64) -> (n: int, err: Error) {
+7 -7
View File
@@ -440,7 +440,7 @@ foreign libc {
@(link_name="closedir") _unix_closedir :: proc(dirp: Dir) -> c.int ---
@(link_name="rewinddir") _unix_rewinddir :: proc(dirp: Dir) ---
@(link_name="__fcntl") _unix__fcntl :: proc(fd: Handle, cmd: c.int, #c_vararg args: ..any) -> c.int ---
@(link_name="__fcntl") _unix__fcntl :: proc(fd: Handle, cmd: c.int, arg: uintptr) -> c.int ---
@(link_name="rename") _unix_rename :: proc(old: cstring, new: cstring) -> c.int ---
@(link_name="remove") _unix_remove :: proc(path: cstring) -> c.int ---
@@ -794,14 +794,14 @@ _readlink :: proc(path: string) -> (string, Errno) {
}
absolute_path_from_handle :: proc(fd: Handle) -> (string, Errno) {
buf : [256]byte
res := _unix__fcntl(fd, F_GETPATH, &buf[0])
if res != 0 {
return "", Errno(get_last_error())
buf: [DARWIN_MAXPATHLEN]byte
_, err := fcntl(int(fd), F_GETPATH, int(uintptr(&buf[0])))
if err != ERROR_NONE {
return "", err
}
path := strings.clone_from_cstring(cstring(&buf[0]))
return path, ERROR_NONE
return path, err
}
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Errno) {
@@ -1068,7 +1068,7 @@ shutdown :: proc(sd: Socket, how: int) -> (Errno) {
}
fcntl :: proc(fd: int, cmd: int, arg: int) -> (int, Errno) {
result := _unix__fcntl(Handle(fd), c.int(cmd), c.int(arg))
result := _unix__fcntl(Handle(fd), c.int(cmd), uintptr(arg))
if result < 0 {
return 0, Errno(get_last_error())
}
+1 -1
View File
@@ -132,7 +132,7 @@ type_info_core :: runtime.type_info_core
type_info_base_without_enum :: type_info_core
when !ODIN_DISALLOW_RTTI {
when !ODIN_NO_RTTI {
typeid_base :: runtime.typeid_base
typeid_core :: runtime.typeid_core
typeid_base_without_enum :: typeid_core
+1 -1
View File
@@ -566,7 +566,7 @@ __type_info_of :: proc "contextless" (id: typeid) -> ^Type_Info #no_bounds_check
return &type_table[n]
}
when !ODIN_DISALLOW_RTTI {
when !ODIN_NO_RTTI {
typeid_base :: proc "contextless" (id: typeid) -> typeid {
ti := type_info_of(id)
ti = type_info_base(ti)
+1 -1
View File
@@ -122,7 +122,7 @@ matrix_bounds_check_error :: proc "contextless" (file: string, line, column: i32
}
when ODIN_DISALLOW_RTTI {
when ODIN_NO_RTTI {
type_assertion_check :: proc "contextless" (ok: bool, file: string, line, column: i32) {
if ok {
return
+2 -2
View File
@@ -5,7 +5,7 @@ _INTEGER_DIGITS :: "0123456789abcdefghijklmnopqrstuvwxyz"
@(private="file")
_INTEGER_DIGITS_VAR := _INTEGER_DIGITS
when !ODIN_DISALLOW_RTTI {
when !ODIN_NO_RTTI {
print_any_single :: proc "contextless" (arg: any) {
x := arg
if loc, ok := x.(Source_Code_Location); ok {
@@ -234,7 +234,7 @@ print_caller_location :: proc "contextless" (using loc: Source_Code_Location) {
}
}
print_typeid :: proc "contextless" (id: typeid) {
when ODIN_DISALLOW_RTTI {
when ODIN_NO_RTTI {
if id == nil {
print_string("nil")
} else {