Minor fixes

This commit is contained in:
gingerBill
2023-03-16 13:35:38 +00:00
parent 49cf0125a9
commit e05944601a
2 changed files with 7 additions and 3 deletions

View File

@@ -44,7 +44,7 @@ when ODIN_OS == .Windows {
@(link_name="_Cnd_destroy") cnd_destroy :: proc(cond: ^cnd_t) ---
@(link_name="_Cnd_init") cnd_init :: proc(cond: ^cnd_t) -> int ---
@(link_name="_Cnd_signal") cnd_signal :: proc(cond: ^cnd_t) -> int ---
@(link_name="_Cnd_timedwait") cnd_timedwait :: proc(cond: ^cnd_t, ts: ^timespec) -> int ---
@(link_name="_Cnd_timedwait") cnd_timedwait :: proc(cond: ^cnd_t, mtx: ^mtx_t, ts: ^timespec) -> int ---
@(link_name="_Cnd_wait") cnd_wait :: proc(cond: ^cnd_t, mtx: ^mtx_t) -> int ---
// 7.26.4 Mutex functions

View File

@@ -67,7 +67,7 @@ builder_init :: proc{
}
@(private)
_builder_stream_vtable := io.Stream_VTable{
_builder_stream_vtable_obj := io.Stream_VTable{
impl_write = proc(s: io.Stream, p: []byte) -> (n: int, err: io.Error) {
b := (^Builder)(s.stream_data)
n = write_bytes(b, p)
@@ -95,9 +95,13 @@ _builder_stream_vtable := io.Stream_VTable{
},
}
// NOTE(dweiler): Work around a miscompilation bug on Linux still.
@(private)
_builder_stream_vtable := &_builder_stream_vtable_obj
// return an `io.Stream` from a builder
to_stream :: proc(b: ^Builder) -> io.Stream {
return io.Stream{stream_vtable=&_builder_stream_vtable, stream_data=b}
return io.Stream{stream_vtable=_builder_stream_vtable, stream_data=b}
}
// return an `io.Writer` from a builder