mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 09:24:33 +00:00
On macos, Odin was previously swallowing errors that would be reported via stderr. I've confirmed with @laytan on Discord that this fixes the issue.
16 lines
331 B
Odin
16 lines
331 B
Odin
//+build darwin
|
|
//+private
|
|
package runtime
|
|
|
|
import "base:intrinsics"
|
|
|
|
_stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) {
|
|
WRITE :: 0x2000004
|
|
STDERR :: 2
|
|
ret := intrinsics.syscall(WRITE, STDERR, uintptr(raw_data(data)), uintptr(len(data)))
|
|
if ret < 0 {
|
|
return 0, _OS_Errno(-ret)
|
|
}
|
|
return int(ret), 0
|
|
}
|