mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix STDIN, STDOUT, STDERR handles for BSDs
Tested on FreeBSD 14.0 and NetBSD 10.0 OpenBSD is untested, but link names were sourced from: https://github.com/openbsd/src/blob/master/include/stdio.h According to this, OpenBSD shares the same layout as NetBSD. FreeBSD has the same as Darwin in this regard.
This commit is contained in:
@@ -102,10 +102,12 @@ when ODIN_OS == .OpenBSD || ODIN_OS == .NetBSD {
|
|||||||
SEEK_END :: 2
|
SEEK_END :: 2
|
||||||
|
|
||||||
foreign libc {
|
foreign libc {
|
||||||
stderr: ^FILE
|
__sF: [3]FILE
|
||||||
stdin: ^FILE
|
|
||||||
stdout: ^FILE
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stdin: ^FILE = &__sF[0]
|
||||||
|
stdout: ^FILE = &__sF[1]
|
||||||
|
stderr: ^FILE = &__sF[2]
|
||||||
}
|
}
|
||||||
|
|
||||||
when ODIN_OS == .FreeBSD {
|
when ODIN_OS == .FreeBSD {
|
||||||
@@ -127,9 +129,9 @@ when ODIN_OS == .FreeBSD {
|
|||||||
SEEK_END :: 2
|
SEEK_END :: 2
|
||||||
|
|
||||||
foreign libc {
|
foreign libc {
|
||||||
stderr: ^FILE
|
@(link_name="__stderrp") stderr: ^FILE
|
||||||
stdin: ^FILE
|
@(link_name="__stdinp") stdin: ^FILE
|
||||||
stdout: ^FILE
|
@(link_name="__stdoutp") stdout: ^FILE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user