Browse Source

Minor fixes

gingerBill 2 years ago
parent
commit
e05944601a
2 changed files with 7 additions and 3 deletions
  1. 1 1
      core/c/libc/threads.odin
  2. 6 2
      core/strings/builder.odin

+ 1 - 1
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

+ 6 - 2
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