mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-15 06:43:42 +00:00
Use oc_bridge_log for pseudo _stderr_write
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
package runtime
|
||||
|
||||
@(private="file")
|
||||
log_level :: enum i32 {
|
||||
oc_log_level :: enum i32 {
|
||||
ERROR,
|
||||
WARNING,
|
||||
INFO,
|
||||
@@ -11,17 +11,24 @@ log_level :: enum i32 {
|
||||
|
||||
@(private="file", default_calling_convention="c")
|
||||
foreign {
|
||||
oc_log_ext :: proc(
|
||||
level: log_level,
|
||||
function: cstring,
|
||||
file: cstring,
|
||||
line: i32,
|
||||
fmt: cstring,
|
||||
#c_vararg args: ..any,
|
||||
oc_bridge_log :: proc(
|
||||
level: oc_log_level,
|
||||
functionLen: i32,
|
||||
function: cstring,
|
||||
fileLen: i32,
|
||||
file: cstring,
|
||||
line: i32,
|
||||
msgLen: i32,
|
||||
msg: [^]byte,
|
||||
) ---
|
||||
}
|
||||
|
||||
_stderr_write :: proc "contextless" (data: []byte) -> (int, _OS_Errno) {
|
||||
oc_log_ext(.ERROR, "", "", 0, "%.*s", i32(len(data)), raw_data(data))
|
||||
oc_bridge_log(.ERROR,
|
||||
0, "",
|
||||
0, "",
|
||||
0,
|
||||
i32(len(data)), raw_data(data),
|
||||
)
|
||||
return len(data), 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user