aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/all/all_linux.odin6
-rw-r--r--examples/all/all_vendor.odin19
-rw-r--r--examples/test-freestanding/main.odin30
3 files changed, 17 insertions, 38 deletions
diff --git a/examples/all/all_linux.odin b/examples/all/all_linux.odin
new file mode 100644
index 000000000..18bba951c
--- /dev/null
+++ b/examples/all/all_linux.odin
@@ -0,0 +1,6 @@
+//+build linux
+package all
+
+import linux "core:sys/linux"
+
+_ :: linux \ No newline at end of file
diff --git a/examples/all/all_vendor.odin b/examples/all/all_vendor.odin
index fa1e8d995..9cc915778 100644
--- a/examples/all/all_vendor.odin
+++ b/examples/all/all_vendor.odin
@@ -39,10 +39,13 @@ import TTF "vendor:sdl2/ttf"
import vk "vendor:vulkan"
-import NS "vendor:darwin/Foundation"
-import MTL "vendor:darwin/Metal"
-import MTK "vendor:darwin/MetalKit"
-import CA "vendor:darwin/QuartzCore"
+// NOTE(flysand): Since conditional imports are disabled for now I'll have to just disable these
+// when ODIN_OS == "darwin" {
+// import NS "vendor:darwin/Foundation"
+// import MTL "vendor:darwin/Metal"
+// import MTK "vendor:darwin/MetalKit"
+// import CA "vendor:darwin/QuartzCore"
+// }
// NOTE(bill): only one can be checked at a time
import lua_5_4 "vendor:lua/5.4"
@@ -91,10 +94,10 @@ _ :: TTF
_ :: vk
-_ :: NS
-_ :: MTL
-_ :: MTK
-_ :: CA
+// _ :: NS
+// _ :: MTL
+// _ :: MTK
+// _ :: CA
_ :: lua_5_4
diff --git a/examples/test-freestanding/main.odin b/examples/test-freestanding/main.odin
deleted file mode 100644
index 518e3d45e..000000000
--- a/examples/test-freestanding/main.odin
+++ /dev/null
@@ -1,30 +0,0 @@
-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)
-}