diff --git a/examples/test-freestanding/main.odin b/examples/test-freestanding/main.odin new file mode 100644 index 000000000..518e3d45e --- /dev/null +++ b/examples/test-freestanding/main.odin @@ -0,0 +1,30 @@ +package main + +import "core:intrinsics" + +SUS_exit :: uintptr(60) +SUS_write ::uintptr(1) +STDOUT_FILENO :: int(1) + +sus_write :: proc "contextless" (fd: int, buf: cstring, size: uint) -> int { + return int(intrinsics.syscall( + SUS_write, + cast(uintptr) fd, + cast(uintptr) cast(rawptr) buf, + cast(uintptr) size + )) +} + +@(link_name = "sussy_baka") +sus_exit :: proc "contextless" (code: $T)->! { + intrinsics.syscall(SUS_exit, uintptr(code)) + unreachable() +} + +sus :: proc {sus_write, sus_exit} + +@(link_name="_start", export) _start :: proc "c" ()->! { + str :: cstring("Hello, world!\n") + sus_write(STDOUT_FILENO, str, uint(14)); + sus_exit(0) +} diff --git a/test-freestanding b/test-freestanding new file mode 100755 index 000000000..061380878 Binary files /dev/null and b/test-freestanding differ diff --git a/test-freestanding.so b/test-freestanding.so new file mode 100755 index 000000000..22e70ff0d Binary files /dev/null and b/test-freestanding.so differ diff --git a/vendor/glfw/bindings/bindings.odin b/vendor/glfw/bindings/bindings.odin index 96a70db85..a0215834f 100644 --- a/vendor/glfw/bindings/bindings.odin +++ b/vendor/glfw/bindings/bindings.odin @@ -3,10 +3,10 @@ package glfw_bindings import "core:c" import vk "vendor:vulkan" -GLFW_DYNAMIC :: #config(GLFW_DYNAMIC, false) +GLFW_SHARED :: #config(GLFW_SHARED, false) when ODIN_OS == .Windows { - when GLFW_DYNAMIC { + when GLFW_SHARED { foreign import glfw { "../lib/glfw3dll.lib", "system:user32.lib",