From e05944601a07e6cb9c0ec84f80ca4ca3511c84ea Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 16 Mar 2023 13:35:38 +0000 Subject: [PATCH] Minor fixes --- core/c/libc/threads.odin | 2 +- core/strings/builder.odin | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/c/libc/threads.odin b/core/c/libc/threads.odin index 60c375bf8..8e3343234 100644 --- a/core/c/libc/threads.odin +++ b/core/c/libc/threads.odin @@ -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 diff --git a/core/strings/builder.odin b/core/strings/builder.odin index 02177ba8c..a6d5b78b4 100644 --- a/core/strings/builder.odin +++ b/core/strings/builder.odin @@ -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