mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-15 18:32:22 -07:00
e94c4e1e18
https://github.com/odin-lang/Odin/commit/d0709a7de21efded4625167dbff4a7dd13d561b4 fixes those another way.
14 lines
287 B
Odin
14 lines
287 B
Odin
//+private
|
|
package os2
|
|
|
|
import "base:runtime"
|
|
|
|
_temp_dir :: proc(allocator: runtime.Allocator) -> (string, runtime.Allocator_Error) {
|
|
TEMP_ALLOCATOR_GUARD()
|
|
tmpdir := get_env("TMPDIR", temp_allocator())
|
|
if tmpdir == "" {
|
|
tmpdir = "/tmp"
|
|
}
|
|
return clone_string(tmpdir, allocator)
|
|
}
|