aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-03-16 13:35:38 +0000
committergingerBill <bill@gingerbill.org>2023-03-16 13:35:38 +0000
commite05944601a07e6cb9c0ec84f80ca4ca3511c84ea (patch)
tree79737628ab43980caa1c618c079bf0873f284c2e
parent49cf0125a936bdc5406ec7dcb0837470992f676c (diff)
Minor fixes
-rw-r--r--core/c/libc/threads.odin2
-rw-r--r--core/strings/builder.odin8
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