Merge pull request #4335 from colrdavidson/datetime_tz

Add Timezone Support to Odin
This commit is contained in:
Jeroen van Rijn
2024-10-22 10:18:38 +02:00
committed by GitHub
15 changed files with 1662 additions and 31 deletions
+2 -4
View File
@@ -1026,7 +1026,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (path: string, err: Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -1041,9 +1041,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
}
defer _unix_free(rawptr(path_ptr))
path = strings.clone(string(path_ptr))
return path, nil
return strings.clone(string(path_ptr), allocator)
}
access :: proc(path: string, mask: int) -> bool {
+2 -5
View File
@@ -789,7 +789,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -804,10 +804,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
}
defer _unix_free(rawptr(path_ptr))
path = strings.clone(string(path_ptr))
return path, nil
return strings.clone(string(path_ptr), allocator)
}
access :: proc(path: string, mask: int) -> (bool, Error) {
+2 -4
View File
@@ -431,7 +431,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -447,9 +447,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
defer _unix_free(path_ptr)
path_cstr := cstring(path_ptr)
path = strings.clone(string(path_cstr))
return path, nil
return strings.clone(string(path_cstr), allocator)
}
access :: proc(path: string, mask: int) -> (bool, Error) {
+2 -4
View File
@@ -917,7 +917,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -932,9 +932,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
}
defer _unix_free(rawptr(path_ptr))
path = strings.clone(string(path_ptr))
return path, nil
return strings.clone(string(path_ptr), allocator)
}
access :: proc(path: string, mask: int) -> (bool, Error) {
+2 -4
View File
@@ -844,7 +844,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (path: string, err: Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -859,9 +859,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
}
defer _unix_free(rawptr(path_ptr))
path = strings.clone(string(path_ptr))
return path, nil
return strings.clone(string(path_ptr), allocator)
}
access :: proc(path: string, mask: int) -> (bool, Error) {
+2 -4
View File
@@ -758,7 +758,7 @@ absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) {
}
@(require_results)
absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
absolute_path_from_relative :: proc(rel: string, allocator := context.allocator) -> (path: string, err: Error) {
rel := rel
if rel == "" {
rel = "."
@@ -773,9 +773,7 @@ absolute_path_from_relative :: proc(rel: string) -> (path: string, err: Error) {
}
defer _unix_free(rawptr(path_ptr))
path = strings.clone(string(path_ptr))
return path, nil
return strings.clone(string(path_ptr), allocator)
}
access :: proc(path: string, mask: int) -> (bool, Error) {