aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/c/c.odin8
-rw-r--r--core/c/libc/complex.odin4
-rw-r--r--core/c/libc/ctype.odin4
-rw-r--r--core/c/libc/errno.odin10
-rw-r--r--core/c/libc/math.odin4
-rw-r--r--core/c/libc/setjmp.odin6
-rw-r--r--core/c/libc/signal.odin10
-rw-r--r--core/c/libc/stdio.odin10
-rw-r--r--core/c/libc/stdlib.odin10
-rw-r--r--core/c/libc/string.odin4
-rw-r--r--core/c/libc/threads.odin6
-rw-r--r--core/c/libc/time.odin8
-rw-r--r--core/c/libc/uchar.odin4
-rw-r--r--core/c/libc/wchar.odin4
-rw-r--r--core/c/libc/wctype.odin10
-rw-r--r--core/crypto/_fiat/field_poly1305/field.odin2
-rw-r--r--core/crypto/chacha20/chacha20.odin2
-rw-r--r--core/crypto/rand_generic.odin2
-rw-r--r--core/image/png/example.odin2
-rw-r--r--core/image/png/helpers.odin2
-rw-r--r--core/os/file_windows.odin2
-rw-r--r--core/os/os.odin2
-rw-r--r--core/os/os2/user.odin16
-rw-r--r--core/os/os_darwin.odin2
-rw-r--r--core/os/os_linux.odin26
-rw-r--r--core/os/stream.odin6
-rw-r--r--core/path/filepath/match.odin10
-rw-r--r--core/path/filepath/path.odin4
-rw-r--r--core/path/filepath/path_unix.odin4
-rw-r--r--core/runtime/core.odin2
-rw-r--r--core/runtime/default_allocators_nil.odin2
-rw-r--r--core/runtime/default_temporary_allocator.odin2
-rw-r--r--core/runtime/entry_windows.odin2
-rw-r--r--core/runtime/error_checks.odin4
-rw-r--r--core/runtime/internal.odin2
-rw-r--r--core/runtime/procs.odin4
-rw-r--r--core/sync/sync2/primitives.odin2
-rw-r--r--core/sync/sync2/primitives_internal.odin2
-rw-r--r--core/sys/unix/syscalls_linux.odin8
-rw-r--r--core/time/time_unix.odin2
-rw-r--r--src/checker.cpp37
-rw-r--r--vendor/ENet/enet.odin4
-rw-r--r--vendor/OpenGL/helpers.odin2
-rw-r--r--vendor/botan/bindings/botan.odin6
-rw-r--r--vendor/glfw/bindings/bindings.odin6
-rw-r--r--vendor/glfw/native.odin6
-rw-r--r--vendor/miniaudio/common.odin6
-rw-r--r--vendor/miniaudio/data_conversion.odin4
-rw-r--r--vendor/miniaudio/decoding.odin4
-rw-r--r--vendor/miniaudio/device_io_procs.odin4
-rw-r--r--vendor/miniaudio/device_io_types.odin32
-rw-r--r--vendor/miniaudio/encoding.odin4
-rw-r--r--vendor/miniaudio/filtering.odin4
-rw-r--r--vendor/miniaudio/generation.odin4
-rw-r--r--vendor/miniaudio/logging.odin4
-rw-r--r--vendor/miniaudio/utilities.odin4
-rw-r--r--vendor/miniaudio/vfs.odin4
-rw-r--r--vendor/portmidi/portmidi.odin2
-rw-r--r--vendor/portmidi/util.odin2
-rw-r--r--vendor/raylib/raylib.odin6
-rw-r--r--vendor/raylib/rlgl.odin6
-rw-r--r--vendor/sdl2/image/sdl_image.odin8
-rw-r--r--vendor/sdl2/mixer/sdl_mixer.odin8
-rw-r--r--vendor/sdl2/net/sdl_net.odin8
-rw-r--r--vendor/sdl2/sdl2.odin8
-rw-r--r--vendor/sdl2/sdl_audio.odin8
-rw-r--r--vendor/sdl2/sdl_blendmode.odin8
-rw-r--r--vendor/sdl2/sdl_cpuinfo.odin8
-rw-r--r--vendor/sdl2/sdl_events.odin8
-rw-r--r--vendor/sdl2/sdl_gamecontroller.odin8
-rw-r--r--vendor/sdl2/sdl_gesture_haptic.odin8
-rw-r--r--vendor/sdl2/sdl_hints.odin8
-rw-r--r--vendor/sdl2/sdl_joystick.odin8
-rw-r--r--vendor/sdl2/sdl_keyboard.odin8
-rw-r--r--vendor/sdl2/sdl_log.odin8
-rw-r--r--vendor/sdl2/sdl_messagebox.odin8
-rw-r--r--vendor/sdl2/sdl_metal.odin8
-rw-r--r--vendor/sdl2/sdl_mouse.odin8
-rw-r--r--vendor/sdl2/sdl_mutex.odin8
-rw-r--r--vendor/sdl2/sdl_pixels.odin8
-rw-r--r--vendor/sdl2/sdl_rect.odin8
-rw-r--r--vendor/sdl2/sdl_render.odin8
-rw-r--r--vendor/sdl2/sdl_rwops.odin8
-rw-r--r--vendor/sdl2/sdl_stdinc.odin8
-rw-r--r--vendor/sdl2/sdl_surface.odin8
-rw-r--r--vendor/sdl2/sdl_system.odin8
-rw-r--r--vendor/sdl2/sdl_syswm.odin8
-rw-r--r--vendor/sdl2/sdl_thread.odin8
-rw-r--r--vendor/sdl2/sdl_timer.odin8
-rw-r--r--vendor/sdl2/sdl_touch.odin8
-rw-r--r--vendor/sdl2/sdl_video.odin8
-rw-r--r--vendor/sdl2/sdl_vulkan.odin8
-rw-r--r--vendor/sdl2/ttf/sdl_ttf.odin8
-rw-r--r--vendor/stb/image/stb_image.odin4
-rw-r--r--vendor/stb/image/stb_image_resize.odin4
-rw-r--r--vendor/stb/image/stb_image_write.odin4
-rw-r--r--vendor/stb/rect_pack/stb_rect_pack.odin4
-rw-r--r--vendor/stb/truetype/stb_truetype.odin4
-rw-r--r--vendor/stb/vorbis/stb_vorbis.odin4
-rw-r--r--vendor/vulkan/_gen/create_vulkan_odin_wrapper.py2
-rw-r--r--vendor/vulkan/structs.odin2
101 files changed, 341 insertions, 310 deletions
diff --git a/core/c/c.odin b/core/c/c.odin
index d0b8e377f..05732476f 100644
--- a/core/c/c.odin
+++ b/core/c/c.odin
@@ -7,20 +7,20 @@ char :: builtin.u8 // assuming -funsigned-char
schar :: builtin.i8
short :: builtin.i16
int :: builtin.i32
-long :: builtin.i32 when (ODIN_OS == "windows" || size_of(builtin.rawptr) == 4) else builtin.i64
+long :: builtin.i32 when (ODIN_OS == .Windows || size_of(builtin.rawptr) == 4) else builtin.i64
longlong :: builtin.i64
uchar :: builtin.u8
ushort :: builtin.u16
uint :: builtin.u32
-ulong :: builtin.u32 when (ODIN_OS == "windows" || size_of(builtin.rawptr) == 4) else builtin.u64
+ulong :: builtin.u32 when (ODIN_OS == .Windows || size_of(builtin.rawptr) == 4) else builtin.u64
ulonglong :: builtin.u64
bool :: builtin.bool
size_t :: builtin.uint
ssize_t :: builtin.int
-wchar_t :: builtin.u16 when (ODIN_OS == "windows") else builtin.u32
+wchar_t :: builtin.u16 when (ODIN_OS == .Windows) else builtin.u32
float :: builtin.f32
double :: builtin.f64
@@ -48,7 +48,7 @@ int_least64_t :: builtin.i64
uint_least64_t :: builtin.u64
// Same on Windows, Linux, and FreeBSD
-when ODIN_ARCH == "i386" || ODIN_ARCH == "amd64" {
+when ODIN_ARCH == .i386 || ODIN_ARCH == .amd64 {
int_fast8_t :: builtin.i8
uint_fast8_t :: builtin.u8
int_fast16_t :: builtin.i32
diff --git a/core/c/libc/complex.odin b/core/c/libc/complex.odin
index 62b28f0cd..22c422cce 100644
--- a/core/c/libc/complex.odin
+++ b/core/c/libc/complex.odin
@@ -2,9 +2,9 @@ package libc
// 7.3 Complex arithmetic
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
diff --git a/core/c/libc/ctype.odin b/core/c/libc/ctype.odin
index 05d9dcd37..185385a5e 100644
--- a/core/c/libc/ctype.odin
+++ b/core/c/libc/ctype.odin
@@ -1,8 +1,8 @@
package libc
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
diff --git a/core/c/libc/errno.odin b/core/c/libc/errno.odin
index 8ebe2f734..ecde6af59 100644
--- a/core/c/libc/errno.odin
+++ b/core/c/libc/errno.odin
@@ -2,9 +2,9 @@ package libc
// 7.5 Errors
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
@@ -14,7 +14,7 @@ when ODIN_OS == "windows" {
// EDOM,
// EILSEQ
// ERANGE
-when ODIN_OS == "linux" || ODIN_OS == "freebsd" {
+when ODIN_OS == .Linux || ODIN_OS == .FreeBSD {
@(private="file")
@(default_calling_convention="c")
foreign libc {
@@ -27,7 +27,7 @@ when ODIN_OS == "linux" || ODIN_OS == "freebsd" {
ERANGE :: 34
}
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
@(private="file")
@(default_calling_convention="c")
foreign libc {
@@ -40,7 +40,7 @@ when ODIN_OS == "windows" {
ERANGE :: 34
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
@(private="file")
@(default_calling_convention="c")
foreign libc {
diff --git a/core/c/libc/math.odin b/core/c/libc/math.odin
index ee702b82e..97f77236f 100644
--- a/core/c/libc/math.odin
+++ b/core/c/libc/math.odin
@@ -4,9 +4,9 @@ package libc
import "core:intrinsics"
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
diff --git a/core/c/libc/setjmp.odin b/core/c/libc/setjmp.odin
index dcd4a9c64..c2cd1d047 100644
--- a/core/c/libc/setjmp.odin
+++ b/core/c/libc/setjmp.odin
@@ -2,14 +2,14 @@ package libc
// 7.13 Nonlocal jumps
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
}
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
@(default_calling_convention="c")
foreign libc {
// 7.13.1 Save calling environment
diff --git a/core/c/libc/signal.odin b/core/c/libc/signal.odin
index e1044dc02..186b74d8c 100644
--- a/core/c/libc/signal.odin
+++ b/core/c/libc/signal.odin
@@ -2,9 +2,9 @@ package libc
// 7.14 Signal handling
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
@@ -21,7 +21,7 @@ foreign libc {
raise :: proc(sig: int) -> int ---
}
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
SIG_ERR :: rawptr(~uintptr(0))
SIG_DFL :: rawptr(uintptr(0))
SIG_IGN :: rawptr(uintptr(1))
@@ -34,7 +34,7 @@ when ODIN_OS == "windows" {
SIGTERM :: 15
}
-when ODIN_OS == "linux" || ODIN_OS == "freebsd" {
+when ODIN_OS == .Linux || ODIN_OS == .FreeBSD {
SIG_ERR :: rawptr(~uintptr(0))
SIG_DFL :: rawptr(uintptr(0))
SIG_IGN :: rawptr(uintptr(1))
@@ -47,7 +47,7 @@ when ODIN_OS == "linux" || ODIN_OS == "freebsd" {
SIGTERM :: 15
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
SIG_ERR :: rawptr(~uintptr(0))
SIG_DFL :: rawptr(uintptr(0))
SIG_IGN :: rawptr(uintptr(1))
diff --git a/core/c/libc/stdio.odin b/core/c/libc/stdio.odin
index 4a39c22e9..33be34625 100644
--- a/core/c/libc/stdio.odin
+++ b/core/c/libc/stdio.odin
@@ -1,8 +1,8 @@
package libc
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
@@ -13,7 +13,7 @@ when ODIN_OS == "windows" {
FILE :: struct {}
// MSVCRT compatible.
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
_IOFBF :: 0x0000
_IONBF :: 0x0004
_IOLBF :: 0x0040
@@ -48,7 +48,7 @@ when ODIN_OS == "windows" {
}
// GLIBC and MUSL compatible.
-when ODIN_OS == "linux" {
+when ODIN_OS == .Linux {
fpos_t :: struct #raw_union { _: [16]char, _: longlong, _: double, }
_IOFBF :: 0
@@ -78,7 +78,7 @@ when ODIN_OS == "linux" {
}
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
fpos_t :: distinct i64
_IOFBF :: 0
diff --git a/core/c/libc/stdlib.odin b/core/c/libc/stdlib.odin
index b368c0cee..a278db0ef 100644
--- a/core/c/libc/stdlib.odin
+++ b/core/c/libc/stdlib.odin
@@ -2,15 +2,15 @@ package libc
// 7.22 General utilities
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
}
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
RAND_MAX :: 0x7fff
@(private="file")
@@ -24,7 +24,7 @@ when ODIN_OS == "windows" {
}
}
-when ODIN_OS == "linux" {
+when ODIN_OS == .Linux {
RAND_MAX :: 0x7fffffff
// GLIBC and MUSL only
@@ -40,7 +40,7 @@ when ODIN_OS == "linux" {
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
RAND_MAX :: 0x7fffffff
// GLIBC and MUSL only
diff --git a/core/c/libc/string.odin b/core/c/libc/string.odin
index c91124dcb..8f83ee1b9 100644
--- a/core/c/libc/string.odin
+++ b/core/c/libc/string.odin
@@ -4,9 +4,9 @@ import "core:runtime"
// 7.24 String handling
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
diff --git a/core/c/libc/threads.odin b/core/c/libc/threads.odin
index ad305b517..a7a45150d 100644
--- a/core/c/libc/threads.odin
+++ b/core/c/libc/threads.odin
@@ -5,7 +5,7 @@ package libc
thrd_start_t :: proc "c" (rawptr) -> int
tss_dtor_t :: proc "c" (rawptr)
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc {
"system:libucrt.lib",
"system:msvcprt.lib"
@@ -74,7 +74,7 @@ when ODIN_OS == "windows" {
}
// GLIBC and MUSL compatible constants and types.
-when ODIN_OS == "linux" {
+when ODIN_OS == .Linux {
foreign import libc {
"system:c",
"system:pthread"
@@ -138,6 +138,6 @@ when ODIN_OS == "linux" {
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
// TODO: find out what this is meant to be!
}
diff --git a/core/c/libc/time.odin b/core/c/libc/time.odin
index 96e80e216..b3539a227 100644
--- a/core/c/libc/time.odin
+++ b/core/c/libc/time.odin
@@ -2,9 +2,9 @@ package libc
// 7.27 Date and time
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
@@ -12,7 +12,7 @@ when ODIN_OS == "windows" {
// We enforce 64-bit time_t and timespec as there is no reason to use 32-bit as
// we approach the 2038 problem. Windows has defaulted to this since VC8 (2005).
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign libc {
// 7.27.2 Time manipulation functions
clock :: proc() -> clock_t ---
@@ -45,7 +45,7 @@ when ODIN_OS == "windows" {
}
}
-when ODIN_OS == "linux" || ODIN_OS == "freebsd" || ODIN_OS == "darwin" {
+when ODIN_OS == .Linux || ODIN_OS == .FreeBSD || ODIN_OS == .Darwin {
@(default_calling_convention="c")
foreign libc {
// 7.27.2 Time manipulation functions
diff --git a/core/c/libc/uchar.odin b/core/c/libc/uchar.odin
index e49c29e51..a10969ceb 100644
--- a/core/c/libc/uchar.odin
+++ b/core/c/libc/uchar.odin
@@ -2,9 +2,9 @@ package libc
// 7.28 Unicode utilities
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
diff --git a/core/c/libc/wchar.odin b/core/c/libc/wchar.odin
index fc206e494..f2aa8410e 100644
--- a/core/c/libc/wchar.odin
+++ b/core/c/libc/wchar.odin
@@ -2,9 +2,9 @@ package libc
// 7.29 Extended multibyte and wide character utilities
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
diff --git a/core/c/libc/wctype.odin b/core/c/libc/wctype.odin
index 47f17e0b4..942726ba6 100644
--- a/core/c/libc/wctype.odin
+++ b/core/c/libc/wctype.odin
@@ -2,25 +2,25 @@ package libc
// 7.30 Wide character classification and mapping utilities
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import libc "system:libucrt.lib"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import libc "system:System.framework"
} else {
foreign import libc "system:c"
}
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
wctrans_t :: distinct wchar_t
wctype_t :: distinct ushort
}
-when ODIN_OS == "linux" {
+when ODIN_OS == .Linux {
wctrans_t :: distinct intptr_t
wctype_t :: distinct ulong
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
wctrans_t :: distinct int
wctype_t :: distinct u32
}
diff --git a/core/crypto/_fiat/field_poly1305/field.odin b/core/crypto/_fiat/field_poly1305/field.odin
index 4ed8acbff..ca458e079 100644
--- a/core/crypto/_fiat/field_poly1305/field.odin
+++ b/core/crypto/_fiat/field_poly1305/field.odin
@@ -22,7 +22,7 @@ fe_from_bytes :: #force_inline proc (out1: ^Tight_Field_Element, arg1: []byte, a
assert(len(arg1) == 16)
- when ODIN_ARCH == "i386" || ODIN_ARCH == "amd64" {
+ when ODIN_ARCH == .i386 || ODIN_ARCH == .amd64 {
// While it may be unwise to do deserialization here on our
// own when fiat-crypto provides equivalent functionality,
// doing it this way provides a little under 3x performance
diff --git a/core/crypto/chacha20/chacha20.odin b/core/crypto/chacha20/chacha20.odin
index e32dacb2c..229949c22 100644
--- a/core/crypto/chacha20/chacha20.odin
+++ b/core/crypto/chacha20/chacha20.odin
@@ -346,7 +346,7 @@ _do_blocks :: proc (ctx: ^Context, dst, src: []byte, nr_blocks: int) {
// Until dedicated assembly can be written leverage the fact that
// the callers of this routine ensure that src/dst are valid.
- when ODIN_ARCH == "i386" || ODIN_ARCH == "amd64" {
+ when ODIN_ARCH == .i386 || ODIN_ARCH == .amd64 {
// util.PUT_U32_LE/util.U32_LE are not required on little-endian
// systems that also happen to not be strict about aligned
// memory access.
diff --git a/core/crypto/rand_generic.odin b/core/crypto/rand_generic.odin
index 98890b5b1..be6987ee2 100644
--- a/core/crypto/rand_generic.odin
+++ b/core/crypto/rand_generic.odin
@@ -1,6 +1,6 @@
package crypto
-when ODIN_OS != "linux" {
+when ODIN_OS != .Linux {
_rand_bytes :: proc (dst: []byte) {
unimplemented("crypto: rand_bytes not supported on this OS")
}
diff --git a/core/image/png/example.odin b/core/image/png/example.odin
index f4eb5128e..17436c260 100644
--- a/core/image/png/example.odin
+++ b/core/image/png/example.odin
@@ -207,7 +207,7 @@ write_image_as_ppm :: proc(filename: string, image: ^image.Image) -> (success: b
}
mode: int = 0
- when ODIN_OS == "linux" || ODIN_OS == "darwin" {
+ when ODIN_OS == .Linux || ODIN_OS == .Darwin {
// NOTE(justasd): 644 (owner read, write; group read; others read)
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
}
diff --git a/core/image/png/helpers.odin b/core/image/png/helpers.odin
index ecc0183bc..6ec674544 100644
--- a/core/image/png/helpers.odin
+++ b/core/image/png/helpers.odin
@@ -443,7 +443,7 @@ when false {
}
mode: int = 0
- when ODIN_OS == "linux" || ODIN_OS == "darwin" {
+ when ODIN_OS == .Linux || ODIN_OS == .Darwin {
// NOTE(justasd): 644 (owner read, write; group read; others read)
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
}
diff --git a/core/os/file_windows.odin b/core/os/file_windows.odin
index 419f8bbc2..8a0f2ed64 100644
--- a/core/os/file_windows.odin
+++ b/core/os/file_windows.odin
@@ -399,7 +399,7 @@ is_abs :: proc(path: string) -> bool {
if len(path) > 0 && path[0] == '/' {
return true
}
- when ODIN_OS == "windows" {
+ when ODIN_OS == .Windows {
if len(path) > 2 {
switch path[0] {
case 'A'..='Z', 'a'..='z':
diff --git a/core/os/os.odin b/core/os/os.odin
index 83158be80..19a8099ef 100644
--- a/core/os/os.odin
+++ b/core/os/os.odin
@@ -139,7 +139,7 @@ write_entire_file :: proc(name: string, data: []byte, truncate := true) -> (succ
}
mode: int = 0
- when OS == "linux" || OS == "darwin" {
+ when OS == .Linux || OS == .Darwin {
// NOTE(justasd): 644 (owner read, write; group read; others read)
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
}
diff --git a/core/os/os2/user.odin b/core/os/os2/user.odin
index 6dd99c621..976e61bb1 100644
--- a/core/os/os2/user.odin
+++ b/core/os/os2/user.odin
@@ -3,13 +3,13 @@ package os2
import "core:strings"
user_cache_dir :: proc(allocator := context.allocator) -> (dir: string, is_defined: bool) {
- switch ODIN_OS {
- case "windows":
+ #partial switch ODIN_OS {
+ case .Windows:
dir = get_env("LocalAppData")
if dir != "" {
dir = strings.clone(dir, allocator)
}
- case "darwin":
+ case .Darwin:
dir = get_env("HOME")
if dir != "" {
dir = strings.concatenate({dir, "/Library/Caches"}, allocator)
@@ -29,13 +29,13 @@ user_cache_dir :: proc(allocator := context.allocator) -> (dir: string, is_defin
}
user_config_dir :: proc(allocator := context.allocator) -> (dir: string, is_defined: bool) {
- switch ODIN_OS {
- case "windows":
+ #partial switch ODIN_OS {
+ case .Windows:
dir = get_env("AppData")
if dir != "" {
dir = strings.clone(dir, allocator)
}
- case "darwin":
+ case .Darwin:
dir = get_env("HOME")
if dir != "" {
dir = strings.concatenate({dir, "/Library/Application Support"}, allocator)
@@ -56,8 +56,8 @@ user_config_dir :: proc(allocator := context.allocator) -> (dir: string, is_defi
user_home_dir :: proc() -> (dir: string, is_defined: bool) {
env := "HOME"
- switch ODIN_OS {
- case "windows":
+ #partial switch ODIN_OS {
+ case .Windows:
env = "USERPROFILE"
}
if v := get_env(env); v != "" {
diff --git a/core/os/os_darwin.odin b/core/os/os_darwin.odin
index b32453a5d..4828c5167 100644
--- a/core/os/os_darwin.odin
+++ b/core/os/os_darwin.odin
@@ -335,7 +335,7 @@ open :: proc(path: string, flags: int = O_RDWR, mode: int = 0) -> (Handle, Errno
return INVALID_HANDLE, 1
}
-when ODIN_OS == "darwin" && ODIN_ARCH == "arm64" {
+when ODIN_OS == .Darwin && ODIN_ARCH == .arm64 {
if mode != 0 {
err := fchmod(handle, cast(u16)mode)
if err != 0 {
diff --git a/core/os/os_linux.odin b/core/os/os_linux.odin
index 1c796f1b8..3eb76249c 100644
--- a/core/os/os_linux.odin
+++ b/core/os/os_linux.odin
@@ -271,7 +271,7 @@ AT_REMOVEDIR :: uintptr(0x200)
AT_SYMLINK_NOFOLLOW :: uintptr(0x100)
_unix_open :: proc(path: cstring, flags: int, mode: int = 0o000) -> Handle {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
res := int(intrinsics.syscall(unix.SYS_open, uintptr(rawptr(path)), uintptr(flags), uintptr(mode)))
} else { // NOTE: arm64 does not have open
res := int(intrinsics.syscall(unix.SYS_openat, uintptr(AT_FDCWD), uintptr(rawptr(path), uintptr(flags), uintptr(mode))))
@@ -292,7 +292,7 @@ _unix_write :: proc(fd: Handle, buf: rawptr, size: uint) -> int {
}
_unix_seek :: proc(fd: Handle, offset: i64, whence: int) -> i64 {
- when ODIN_ARCH == "amd64" || ODIN_ARCH == "arm64" {
+ when ODIN_ARCH == .amd64 || ODIN_ARCH == .arm64 {
return i64(intrinsics.syscall(unix.SYS_lseek, uintptr(fd), uintptr(offset), uintptr(whence)))
} else {
low := uintptr(offset & 0xFFFFFFFF)
@@ -304,9 +304,9 @@ _unix_seek :: proc(fd: Handle, offset: i64, whence: int) -> i64 {
}
_unix_stat :: proc(path: cstring, stat: ^OS_Stat) -> int {
- when ODIN_ARCH == "amd64" {
+ when ODIN_ARCH == .amd64 {
return int(intrinsics.syscall(unix.SYS_stat, uintptr(rawptr(path)), uintptr(stat)))
- } else when ODIN_ARCH != "arm64" {
+ } else when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_stat64, uintptr(rawptr(path)), uintptr(stat)))
} else { // NOTE: arm64 does not have stat
return int(intrinsics.syscall(unix.SYS_fstatat, uintptr(AT_FDCWD), uintptr(rawptr(path)), uintptr(stat), 0))
@@ -314,7 +314,7 @@ _unix_stat :: proc(path: cstring, stat: ^OS_Stat) -> int {
}
_unix_fstat :: proc(fd: Handle, stat: ^OS_Stat) -> int {
- when ODIN_ARCH == "amd64" || ODIN_ARCH == "arm64" {
+ when ODIN_ARCH == .amd64 || ODIN_ARCH == .arm64 {
return int(intrinsics.syscall(unix.SYS_fstat, uintptr(fd), uintptr(stat)))
} else {
return int(intrinsics.syscall(unix.SYS_fstat64, uintptr(fd), uintptr(stat)))
@@ -322,9 +322,9 @@ _unix_fstat :: proc(fd: Handle, stat: ^OS_Stat) -> int {
}
_unix_lstat :: proc(path: cstring, stat: ^OS_Stat) -> int {
- when ODIN_ARCH == "amd64" {
+ when ODIN_ARCH == .amd64 {
return int(intrinsics.syscall(unix.SYS_lstat, uintptr(rawptr(path)), uintptr(stat)))
- } else when ODIN_ARCH != "arm64" {
+ } else when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_lstat64, uintptr(rawptr(path)), uintptr(stat)))
} else { // NOTE: arm64 does not have any lstat
return int(intrinsics.syscall(unix.SYS_fstatat, uintptr(AT_FDCWD), uintptr(rawptr(path)), uintptr(stat), AT_SYMLINK_NOFOLLOW))
@@ -332,7 +332,7 @@ _unix_lstat :: proc(path: cstring, stat: ^OS_Stat) -> int {
}
_unix_readlink :: proc(path: cstring, buf: rawptr, bufsiz: uint) -> int {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_readlink, uintptr(rawptr(path)), uintptr(buf), uintptr(bufsiz)))
} else { // NOTE: arm64 does not have readlink
return int(intrinsics.syscall(unix.SYS_readlinkat, uintptr(AT_FDCWD), uintptr(rawptr(path)), uintptr(buf), uintptr(bufsiz)))
@@ -340,7 +340,7 @@ _unix_readlink :: proc(path: cstring, buf: rawptr, bufsiz: uint) -> int {
}
_unix_access :: proc(path: cstring, mask: int) -> int {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_access, uintptr(rawptr(path)), uintptr(mask)))
} else { // NOTE: arm64 does not have access
return int(intrinsics.syscall(unix.SYS_faccessat, uintptr(AT_FDCWD), uintptr(rawptr(path)), uintptr(mask)))
@@ -356,7 +356,7 @@ _unix_chdir :: proc(path: cstring) -> int {
}
_unix_rename :: proc(old, new: cstring) -> int {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_rename, uintptr(rawptr(old)), uintptr(rawptr(new))))
} else { // NOTE: arm64 does not have rename
return int(intrinsics.syscall(unix.SYS_renameat, uintptr(AT_FDCWD), uintptr(rawptr(old)), uintptr(rawptr(new))))
@@ -364,7 +364,7 @@ _unix_rename :: proc(old, new: cstring) -> int {
}
_unix_unlink :: proc(path: cstring) -> int {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_unlink, uintptr(rawptr(path))))
} else { // NOTE: arm64 does not have unlink
return int(intrinsics.syscall(unix.SYS_unlinkat, uintptr(AT_FDCWD), uintptr(rawptr(path), 0)))
@@ -372,7 +372,7 @@ _unix_unlink :: proc(path: cstring) -> int {
}
_unix_rmdir :: proc(path: cstring) -> int {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_rmdir, uintptr(rawptr(path))))
} else { // NOTE: arm64 does not have rmdir
return int(intrinsics.syscall(unix.SYS_unlinkat, uintptr(AT_FDCWD), uintptr(rawptr(path)), AT_REMOVEDIR))
@@ -380,7 +380,7 @@ _unix_rmdir :: proc(path: cstring) -> int {
}
_unix_mkdir :: proc(path: cstring, mode: u32) -> int {
- when ODIN_ARCH != "arm64" {
+ when ODIN_ARCH != .arm64 {
return int(intrinsics.syscall(unix.SYS_mkdir, uintptr(rawptr(path)), uintptr(mode)))
} else { // NOTE: arm64 does not have mkdir
return int(intrinsics.syscall(unix.SYS_mkdirat, uintptr(AT_FDCWD), uintptr(rawptr(path)), uintptr(mode)))
diff --git a/core/os/stream.odin b/core/os/stream.odin
index 5cf5c8405..2c6e1d47f 100644
--- a/core/os/stream.odin
+++ b/core/os/stream.odin
@@ -19,7 +19,7 @@ _file_stream_vtable := &io.Stream_VTable{
return
},
impl_read_at = proc(s: io.Stream, p: []byte, offset: i64) -> (n: int, err: io.Error) {
- when ODIN_OS == "windows" || ODIN_OS == "wasi" {
+ when ODIN_OS == .Windows || ODIN_OS == .WASI {
fd := Handle(uintptr(s.stream_data))
os_err: Errno
n, os_err = read_at(fd, p, offset)
@@ -33,7 +33,7 @@ _file_stream_vtable := &io.Stream_VTable{
return
},
impl_write_at = proc(s: io.Stream, p: []byte, offset: i64) -> (n: int, err: io.Error) {
- when ODIN_OS == "windows" || ODIN_OS == "wasi" {
+ when ODIN_OS == .Windows || ODIN_OS == .WASI {
fd := Handle(uintptr(s.stream_data))
os_err: Errno
n, os_err = write_at(fd, p, offset)
@@ -53,7 +53,7 @@ _file_stream_vtable := &io.Stream_VTable{
return sz
},
impl_flush = proc(s: io.Stream) -> io.Error {
- when ODIN_OS == "windows" {
+ when ODIN_OS == .Windows {
fd := Handle(uintptr(s.stream_data))
flush(fd)
} else {
diff --git a/core/path/filepath/match.odin b/core/path/filepath/match.odin
index cba44953d..c045f3ece 100644
--- a/core/path/filepath/match.odin
+++ b/core/path/filepath/match.odin
@@ -89,7 +89,7 @@ scan_chunk :: proc(pattern: string) -> (star: bool, chunk, rest: string) {
scan_loop: for i = 0; i < len(pattern); i += 1 {
switch pattern[i] {
case '\\':
- when ODIN_OS != "windows" {
+ when ODIN_OS != .Windows {
if i+1 < len(pattern) {
i += 1
}
@@ -161,7 +161,7 @@ match_chunk :: proc(chunk, s: string) -> (rest: string, ok: bool, err: Match_Err
chunk = chunk[1:]
case '\\':
- when ODIN_OS != "windows" {
+ when ODIN_OS != .Windows {
chunk = chunk[1:]
if len(chunk) == 0 {
err = .Syntax_Error
@@ -188,7 +188,7 @@ get_escape :: proc(chunk: string) -> (r: rune, next_chunk: string, err: Match_Er
return
}
chunk := chunk
- if chunk[0] == '\\' && ODIN_OS != "windows" {
+ if chunk[0] == '\\' && ODIN_OS != .Windows {
chunk = chunk[1:]
if len(chunk) == 0 {
err = .Syntax_Error
@@ -231,7 +231,7 @@ glob :: proc(pattern: string, allocator := context.allocator) -> (matches: []str
dir, file := split(pattern)
volume_len := 0
- when ODIN_OS == "windows" {
+ when ODIN_OS == .Windows {
volume_len, dir = clean_glob_path_windows(dir, temp_buf[:])
} else {
dir = clean_glob_path(dir)
@@ -308,7 +308,7 @@ _glob :: proc(dir, pattern: string, matches: ^[dynamic]string) -> (m: [dynamic]s
@(private)
has_meta :: proc(path: string) -> bool {
- when ODIN_OS == "windows" {
+ when ODIN_OS == .Windows {
CHARS :: `*?[`
} else {
CHARS :: `*?[\`
diff --git a/core/path/filepath/path.odin b/core/path/filepath/path.odin
index 39cd80a47..d6e36f649 100644
--- a/core/path/filepath/path.odin
+++ b/core/path/filepath/path.odin
@@ -8,7 +8,7 @@ import "core:strings"
is_separator :: proc(c: byte) -> bool {
switch c {
case '/': return true
- case '\\': return ODIN_OS == "windows"
+ case '\\': return ODIN_OS == .Windows
}
return false
}
@@ -32,7 +32,7 @@ volume_name :: proc(path: string) -> string {
}
volume_name_len :: proc(path: string) -> int {
- if ODIN_OS == "windows" {
+ if ODIN_OS == .Windows {
if len(path) < 2 {
return 0
}
diff --git a/core/path/filepath/path_unix.odin b/core/path/filepath/path_unix.odin
index 1db528a2f..3e49c4710 100644
--- a/core/path/filepath/path_unix.odin
+++ b/core/path/filepath/path_unix.odin
@@ -1,7 +1,7 @@
//+build linux, darwin, freebsd
package filepath
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
foreign import libc "System.framework"
} else {
foreign import libc "system:c"
@@ -54,7 +54,7 @@ foreign libc {
@(link_name="free") _unix_free :: proc(ptr: rawptr) ---
}
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
@(private)
foreign libc {
@(link_name="__error") __error :: proc() -> ^i32 ---
diff --git a/core/runtime/core.odin b/core/runtime/core.odin
index 424650828..cd76b0bb5 100644
--- a/core/runtime/core.odin
+++ b/core/runtime/core.odin
@@ -539,7 +539,7 @@ __init_context :: proc "contextless" (c: ^Context) {
}
default_assertion_failure_proc :: proc(prefix, message: string, loc: Source_Code_Location) -> ! {
- when ODIN_OS == "freestanding" {
+ when ODIN_OS == .Freestanding {
// Do nothing
} else {
print_caller_location(loc)
diff --git a/core/runtime/default_allocators_nil.odin b/core/runtime/default_allocators_nil.odin
index ccb4a3381..04dea0e19 100644
--- a/core/runtime/default_allocators_nil.odin
+++ b/core/runtime/default_allocators_nil.odin
@@ -32,7 +32,7 @@ nil_allocator :: proc() -> Allocator {
-when ODIN_OS == "freestanding" {
+when ODIN_OS == .Freestanding {
default_allocator_proc :: nil_allocator_proc
default_allocator :: nil_allocator
} \ No newline at end of file
diff --git a/core/runtime/default_temporary_allocator.odin b/core/runtime/default_temporary_allocator.odin
index 01143e222..4337e555b 100644
--- a/core/runtime/default_temporary_allocator.odin
+++ b/core/runtime/default_temporary_allocator.odin
@@ -3,7 +3,7 @@ package runtime
DEFAULT_TEMP_ALLOCATOR_BACKING_SIZE: int : #config(DEFAULT_TEMP_ALLOCATOR_BACKING_SIZE, 1<<22)
-when ODIN_OS == "freestanding" || ODIN_OS == "js" || ODIN_DEFAULT_TO_NIL_ALLOCATOR {
+when ODIN_OS == .Freestanding || ODIN_OS == .JS || ODIN_DEFAULT_TO_NIL_ALLOCATOR {
Default_Temp_Allocator :: struct {}
default_temp_allocator_init :: proc(s: ^Default_Temp_Allocator, size: int, backup_allocator := context.allocator) {}
diff --git a/core/runtime/entry_windows.odin b/core/runtime/entry_windows.odin
index 35a6bb421..2f323cb41 100644
--- a/core/runtime/entry_windows.odin
+++ b/core/runtime/entry_windows.odin
@@ -22,7 +22,7 @@ when ODIN_BUILD_MODE == .Dynamic {
return true
}
} else when !ODIN_TEST && !ODIN_NO_ENTRY_POINT {
- when ODIN_ARCH == "i386" || ODIN_NO_CRT {
+ when ODIN_ARCH == .i386 || ODIN_NO_CRT {
@(link_name="mainCRTStartup", linkage="strong", require)
mainCRTStartup :: proc "stdcall" () -> i32 {
context = default_context()
diff --git a/core/runtime/error_checks.odin b/core/runtime/error_checks.odin
index 7f1aeb2d7..ed75cbea6 100644
--- a/core/runtime/error_checks.odin
+++ b/core/runtime/error_checks.odin
@@ -1,7 +1,7 @@
package runtime
bounds_trap :: proc "contextless" () -> ! {
- when ODIN_OS == "windows" {
+ when ODIN_OS == .Windows {
windows_trap_array_bounds()
} else {
trap()
@@ -9,7 +9,7 @@ bounds_trap :: proc "contextless" () -> ! {
}
type_assertion_trap :: proc "contextless" () -> ! {
- when ODIN_OS == "windows" {
+ when ODIN_OS == .Windows {
windows_trap_type_assertion()
} else {
trap()
diff --git a/core/runtime/internal.odin b/core/runtime/internal.odin
index 7b283a132..0d0e196c4 100644
--- a/core/runtime/internal.odin
+++ b/core/runtime/internal.odin
@@ -3,7 +3,7 @@ package runtime
import "core:intrinsics"
@(private="file")
-IS_WASM :: ODIN_ARCH == "wasm32" || ODIN_ARCH == "wasm64"
+IS_WASM :: ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64
@(private)
RUNTIME_LINKAGE :: "strong" when (
diff --git a/core/runtime/procs.odin b/core/runtime/procs.odin
index 961f6376f..5a1d11fe0 100644
--- a/core/runtime/procs.odin
+++ b/core/runtime/procs.odin
@@ -1,6 +1,6 @@
package runtime
-when ODIN_NO_CRT && ODIN_OS == "windows" {
+when ODIN_NO_CRT && ODIN_OS == .Windows {
foreign import lib "system:NtDll.lib"
@(private="file")
@@ -25,7 +25,7 @@ when ODIN_NO_CRT && ODIN_OS == "windows" {
RtlMoveMemory(dst, src, len)
return dst
}
-} else when ODIN_NO_CRT || (ODIN_ARCH == "wasm32" || ODIN_ARCH == "wasm64") {
+} else when ODIN_NO_CRT || (ODIN_ARCH == .wasm32 || ODIN_ARCH == .wasm64) {
@(link_name="memset", linkage="strong", require)
memset :: proc "c" (ptr: rawptr, val: i32, len: int) -> rawptr {
if ptr != nil && len != 0 {
diff --git a/core/sync/sync2/primitives.odin b/core/sync/sync2/primitives.odin
index 6d056d439..046ecbc35 100644
--- a/core/sync/sync2/primitives.odin
+++ b/core/sync/sync2/primitives.odin
@@ -11,7 +11,7 @@ current_thread_id :: proc "contextless" () -> int {
//
// A Mutex must not be copied after first use
Mutex :: struct {
- impl: _Mutex,
+ impl: _Mutex `This is a tag`,
}
// mutex_lock locks m
diff --git a/core/sync/sync2/primitives_internal.odin b/core/sync/sync2/primitives_internal.odin
index ae7e2599c..eb692c6ae 100644
--- a/core/sync/sync2/primitives_internal.odin
+++ b/core/sync/sync2/primitives_internal.odin
@@ -93,7 +93,7 @@ when #config(ODIN_SYNC_RECURSIVE_MUTEX_USE_FUTEX, true) {
}
-when ODIN_OS != "windows" {
+when ODIN_OS != .Windows {
RW_Mutex_State :: distinct uint
RW_Mutex_State_Half_Width :: size_of(RW_Mutex_State)*8/2
RW_Mutex_State_Is_Writing :: RW_Mutex_State(1)
diff --git a/core/sys/unix/syscalls_linux.odin b/core/sys/unix/syscalls_linux.odin
index 3dc3d2c74..0082c7261 100644
--- a/core/sys/unix/syscalls_linux.odin
+++ b/core/sys/unix/syscalls_linux.odin
@@ -15,7 +15,7 @@ import "core:intrinsics"
// 386: arch/x86/entry/syscalls/sycall_32.tbl
// arm: arch/arm/tools/syscall.tbl
-when ODIN_ARCH == "amd64" {
+when ODIN_ARCH == .amd64 {
SYS_read : uintptr : 0
SYS_write : uintptr : 1
SYS_open : uintptr : 2
@@ -374,7 +374,7 @@ when ODIN_ARCH == "amd64" {
SYS_landlock_add_rule : uintptr : 445
SYS_landlock_restrict_self : uintptr : 446
SYS_memfd_secret : uintptr : 447
-} else when ODIN_ARCH == "arm64" {
+} else when ODIN_ARCH == .arm64 {
SYS_io_setup : uintptr : 0
SYS_io_destroy : uintptr : 1
SYS_io_submit : uintptr : 2
@@ -675,7 +675,7 @@ when ODIN_ARCH == "amd64" {
SYS_landlock_create_ruleset : uintptr : 444
SYS_landlock_add_rule : uintptr : 445
SYS_landlock_restrict_self : uintptr : 446
-} else when ODIN_ARCH == "i386" {
+} else when ODIN_ARCH == .i386 {
SYS_restart_syscall : uintptr : 0
SYS_exit : uintptr : 1
SYS_fork : uintptr : 2
@@ -1112,7 +1112,7 @@ when ODIN_ARCH == "amd64" {
SYS_landlock_add_rule : uintptr : 445
SYS_landlock_restrict_self : uintptr : 446
SYS_memfd_secret : uintptr : 447
-} else when ODIN_ARCH == "arm" {
+} else when false /*ODIN_ARCH == .arm*/ { // TODO
SYS_restart_syscall : uintptr : 0
SYS_exit : uintptr : 1
SYS_fork : uintptr : 2
diff --git a/core/time/time_unix.odin b/core/time/time_unix.odin
index 0d765b72d..9c5c5cc35 100644
--- a/core/time/time_unix.odin
+++ b/core/time/time_unix.odin
@@ -3,7 +3,7 @@ package time
IS_SUPPORTED :: true // NOTE: Times on Darwin are UTC.
-when ODIN_OS == "darwin" {
+when ODIN_OS == .Darwin {
foreign import libc "System.framework"
} else {
foreign import libc "system:c"
diff --git a/src/checker.cpp b/src/checker.cpp
index 63a697072..055d0d356 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -856,11 +856,42 @@ void init_universal(void) {
add_global_bool_constant("false", false);
// TODO(bill): Set through flags in the compiler
- add_global_string_constant("ODIN_OS", bc->ODIN_OS);
- add_global_string_constant("ODIN_ARCH", bc->ODIN_ARCH);
add_global_string_constant("ODIN_VENDOR", bc->ODIN_VENDOR);
add_global_string_constant("ODIN_VERSION", bc->ODIN_VERSION);
add_global_string_constant("ODIN_ROOT", bc->ODIN_ROOT);
+
+ {
+ GlobalEnumValue values[TargetOs_COUNT] = {
+ {"Unknown", TargetOs_Invalid},
+ {"Windows", TargetOs_windows},
+ {"Darwin", TargetOs_darwin},
+ {"Linux", TargetOs_linux},
+ {"Essence", TargetOs_essence},
+ {"FreeBSD", TargetOs_freebsd},
+ {"WASI", TargetOs_wasi},
+ {"JS", TargetOs_js},
+ {"Freestanding", TargetOs_freestanding},
+ };
+
+ auto fields = add_global_enum_type(str_lit("Odin_OS_Type"), values, gb_count_of(values));
+ add_global_enum_constant(fields, "ODIN_OS", bc->metrics.os);
+ add_global_string_constant("ODIN_OS_STRING", target_os_names[bc->metrics.os]);
+ }
+
+ {
+ GlobalEnumValue values[TargetArch_COUNT] = {
+ {"Unknown", TargetArch_Invalid},
+ {"amd64", TargetArch_amd64},
+ {"i386", TargetArch_i386},
+ {"arm64", TargetArch_arm64},
+ {"wasm32", TargetArch_wasm32},
+ {"wasm64", TargetArch_wasm64},
+ };
+
+ auto fields = add_global_enum_type(str_lit("Odin_Arch_Type"), values, gb_count_of(values));
+ add_global_enum_constant(fields, "ODIN_ARCH", bc->metrics.arch);
+ add_global_string_constant("ODIN_ARCH_STRING", target_arch_names[bc->metrics.arch]);
+ }
{
GlobalEnumValue values[BuildMode_COUNT] = {
@@ -875,7 +906,6 @@ void init_universal(void) {
add_global_enum_constant(fields, "ODIN_BUILD_MODE", bc->build_mode);
}
- add_global_string_constant("ODIN_ENDIAN_STRING", target_endian_names[target_endians[bc->metrics.arch]]);
{
GlobalEnumValue values[TargetEndian_COUNT] = {
{"Unknown", TargetEndian_Invalid},
@@ -886,6 +916,7 @@ void init_universal(void) {
auto fields = add_global_enum_type(str_lit("Odin_Endian_Type"), values, gb_count_of(values));
add_global_enum_constant(fields, "ODIN_ENDIAN", target_endians[bc->metrics.arch]);
+ add_global_string_constant("ODIN_ENDIAN_STRING", target_endian_names[target_endians[bc->metrics.arch]]);
}
diff --git a/vendor/ENet/enet.odin b/vendor/ENet/enet.odin
index 8d068fbfc..37e65b497 100644
--- a/vendor/ENet/enet.odin
+++ b/vendor/ENet/enet.odin
@@ -1,7 +1,7 @@
package ENet
-when ODIN_OS == "windows" {
- when ODIN_ARCH == "amd64" {
+when ODIN_OS == .Windows {
+ when ODIN_ARCH == .amd64 {
foreign import ENet {
"lib/enet64.lib",
"system:Ws2_32.lib",
diff --git a/vendor/OpenGL/helpers.odin b/vendor/OpenGL/helpers.odin
index 0a9cffefa..661de318c 100644
--- a/vendor/OpenGL/helpers.odin
+++ b/vendor/OpenGL/helpers.odin
@@ -188,7 +188,7 @@ load_shaders_source :: proc(vs_source, fs_source: string, binary_retrievable :=
load_shaders :: proc{load_shaders_file}
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
update_shader_if_changed :: proc(
vertex_name, fragment_name: string,
program: u32,
diff --git a/vendor/botan/bindings/botan.odin b/vendor/botan/bindings/botan.odin
index d1d88cda0..fdddc99a9 100644
--- a/vendor/botan/bindings/botan.odin
+++ b/vendor/botan/bindings/botan.odin
@@ -136,11 +136,11 @@ totp_t :: ^totp_struct
fpe_struct :: struct{}
fpe_t :: ^fpe_struct
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import botan_lib "botan.lib"
-} else when ODIN_OS == "linux" {
+} else when ODIN_OS == .Linux {
foreign import botan_lib "system:botan-2"
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
foreign import botan_lib "system:botan-2"
}
diff --git a/vendor/glfw/bindings/bindings.odin b/vendor/glfw/bindings/bindings.odin
index 84905f603..f4e39015e 100644
--- a/vendor/glfw/bindings/bindings.odin
+++ b/vendor/glfw/bindings/bindings.odin
@@ -3,9 +3,9 @@ package glfw_bindings
import "core:c"
import vk "vendor:vulkan"
-when ODIN_OS == "linux" { foreign import glfw "system:glfw" } // TODO: Add the billion-or-so static libs to link to in linux
-when ODIN_OS == "darwin" { foreign import glfw "system:glfw" }
-when ODIN_OS == "windows" {
+when ODIN_OS == .Linux { foreign import glfw "system:glfw" } // TODO: Add the billion-or-so static libs to link to in linux
+when ODIN_OS == .Darwin { foreign import glfw "system:glfw" }
+when ODIN_OS == .Windows {
foreign import glfw {
"../lib/glfw3_mt.lib",
"system:user32.lib",
diff --git a/vendor/glfw/native.odin b/vendor/glfw/native.odin
index 871c42af9..902b30656 100644
--- a/vendor/glfw/native.odin
+++ b/vendor/glfw/native.odin
@@ -1,6 +1,6 @@
package glfw
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
import win32 "core:sys/windows"
foreign import glfw { "lib/glfw3.lib", "system:user32.lib", "system:gdi32.lib", "system:shell32.lib" }
@@ -12,7 +12,7 @@ when ODIN_OS == "windows" {
GetWin32Window :: proc(window: WindowHandle) -> win32.HWND ---
GetWGLContext :: proc(window: WindowHandle) -> rawptr ---
}
-} else when ODIN_OS == "linux" {
+} else when ODIN_OS == .Linux {
// TODO: Native Linux
// Display* glfwGetX11Display(void);
// RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
@@ -24,7 +24,7 @@ when ODIN_OS == "windows" {
// struct wl_display* glfwGetWaylandDisplay(void);
// struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
// struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
-} else when ODIN_OS == "darwin" {
+} else when ODIN_OS == .Darwin {
// TODO: Native Darwin
// CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
// id glfwGetCocoaWindow(GLFWwindow* window);
diff --git a/vendor/miniaudio/common.odin b/vendor/miniaudio/common.odin
index 62e32e8b1..75b66101f 100644
--- a/vendor/miniaudio/common.odin
+++ b/vendor/miniaudio/common.odin
@@ -2,8 +2,8 @@ package miniaudio
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
handle :: distinct rawptr
@@ -270,7 +270,7 @@ thread_priority :: enum c.int {
/* Spinlocks are 32-bit for compatibility reasons. */
spinlock :: distinct u32
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
thread :: distinct rawptr
mutex :: distinct rawptr
event :: distinct rawptr
diff --git a/vendor/miniaudio/data_conversion.odin b/vendor/miniaudio/data_conversion.odin
index 1a5c9d265..8a53cc19e 100644
--- a/vendor/miniaudio/data_conversion.odin
+++ b/vendor/miniaudio/data_conversion.odin
@@ -2,8 +2,8 @@ package miniaudio
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
/************************************************************************************************************************************************************
diff --git a/vendor/miniaudio/decoding.odin b/vendor/miniaudio/decoding.odin
index cdddd06fe..52b315f10 100644
--- a/vendor/miniaudio/decoding.odin
+++ b/vendor/miniaudio/decoding.odin
@@ -2,8 +2,8 @@ package miniaudio
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
diff --git a/vendor/miniaudio/device_io_procs.odin b/vendor/miniaudio/device_io_procs.odin
index c9cfb7c04..8d6609186 100644
--- a/vendor/miniaudio/device_io_procs.odin
+++ b/vendor/miniaudio/device_io_procs.odin
@@ -1,7 +1,7 @@
package miniaudio
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
import "core:c"
diff --git a/vendor/miniaudio/device_io_types.odin b/vendor/miniaudio/device_io_types.odin
index 8f43b8640..7778e85cf 100644
--- a/vendor/miniaudio/device_io_types.odin
+++ b/vendor/miniaudio/device_io_types.odin
@@ -2,21 +2,21 @@ package miniaudio
import "core:c"
-SUPPORT_WASAPI :: ODIN_OS == "windows"
-SUPPORT_DSOUND :: ODIN_OS == "windows"
-SUPPORT_WINMM :: ODIN_OS == "windows"
-SUPPORT_COREAUDIO :: ODIN_OS == "darwin"
-SUPPORT_SNDIO :: ODIN_OS == "openbsd"
-SUPPORT_AUDIO4 :: ODIN_OS == "openbsd" || ODIN_OS == "netbsd"
-SUPPORT_OSS :: ODIN_OS == "freebsd"
-SUPPORT_PULSEAUDIO :: ODIN_OS == "linux"
-SUPPORT_ALSA :: ODIN_OS == "linux"
-SUPPORT_JACK :: ODIN_OS == "windows"
-SUPPORT_AAUDIO :: ODIN_OS == "android"
-SUPPORT_OPENSL :: ODIN_OS == "android"
-SUPPORT_WEBAUDIO :: ODIN_OS == "emscripten"
+SUPPORT_WASAPI :: ODIN_OS == .Windows
+SUPPORT_DSOUND :: ODIN_OS == .Windows
+SUPPORT_WINMM :: ODIN_OS == .Windows
+SUPPORT_COREAUDIO :: ODIN_OS == .Darwin
+SUPPORT_SNDIO :: false // ODIN_OS == .OpenBSD
+SUPPORT_AUDIO4 :: false // ODIN_OS == .OpenBSD || ODIN_OS == .NetBSD
+SUPPORT_OSS :: ODIN_OS == .FreeBSD
+SUPPORT_PULSEAUDIO :: ODIN_OS == .Linux
+SUPPORT_ALSA :: ODIN_OS == .Linux
+SUPPORT_JACK :: ODIN_OS == .Windows
+SUPPORT_AAUDIO :: false // ODIN_OS == .Android
+SUPPORT_OPENSL :: false // ODIN_OS == .Android
+SUPPORT_WEBAUDIO :: false // ODIN_OS == .Emscripten
SUPPORT_CUSTOM :: true
-SUPPORT_NULL :: ODIN_OS != "emscripten"
+SUPPORT_NULL :: true // ODIN_OS != .Emscripten
STATE_UNINITIALIZED :: 0
STATE_STOPPED :: 1 /* The device's default state after initialization. */
@@ -895,7 +895,7 @@ context_type :: struct {
RegOpenKeyExA: proc "system" (),
RegCloseKey: proc "system" (),
RegQueryValueExA: proc "system" (),
- } when ODIN_OS == "windows" else struct {}),
+ } when ODIN_OS == .Windows else struct {}),
posix: (struct {
pthreadSO: handle,
@@ -914,7 +914,7 @@ context_type :: struct {
pthread_attr_setschedpolicy: proc "system" (),
pthread_attr_getschedparam: proc "system" (),
pthread_attr_setschedparam: proc "system" (),
- } when ODIN_OS != "windows" else struct {}),
+ } when ODIN_OS != .Windows else struct {}),
_unused: c.int,
},
diff --git a/vendor/miniaudio/encoding.odin b/vendor/miniaudio/encoding.odin
index 866c19010..83f9d5252 100644
--- a/vendor/miniaudio/encoding.odin
+++ b/vendor/miniaudio/encoding.odin
@@ -2,8 +2,8 @@ package miniaudio
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
/************************************************************************************************************************************************************
diff --git a/vendor/miniaudio/filtering.odin b/vendor/miniaudio/filtering.odin
index fec21f33d..4956da173 100644
--- a/vendor/miniaudio/filtering.odin
+++ b/vendor/miniaudio/filtering.odin
@@ -1,7 +1,7 @@
package miniaudio
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
/**************************************************************************************************************************************************************
diff --git a/vendor/miniaudio/generation.odin b/vendor/miniaudio/generation.odin
index c2009967c..c241f00b1 100644
--- a/vendor/miniaudio/generation.odin
+++ b/vendor/miniaudio/generation.odin
@@ -2,8 +2,8 @@ package miniaudio
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
waveform_type :: enum c.int {
sine,
diff --git a/vendor/miniaudio/logging.odin b/vendor/miniaudio/logging.odin
index 54792bff9..35aa54bc9 100644
--- a/vendor/miniaudio/logging.odin
+++ b/vendor/miniaudio/logging.odin
@@ -2,8 +2,8 @@ package miniaudio
import c "core:c/libc"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
MAX_LOG_CALLBACKS :: 4
diff --git a/vendor/miniaudio/utilities.odin b/vendor/miniaudio/utilities.odin
index 1a94550e4..19307a77d 100644
--- a/vendor/miniaudio/utilities.odin
+++ b/vendor/miniaudio/utilities.odin
@@ -1,7 +1,7 @@
package miniaudio
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
@(default_calling_convention="c", link_prefix="ma_")
foreign lib {
diff --git a/vendor/miniaudio/vfs.odin b/vendor/miniaudio/vfs.odin
index fa18afb6b..547fbd265 100644
--- a/vendor/miniaudio/vfs.odin
+++ b/vendor/miniaudio/vfs.odin
@@ -2,8 +2,8 @@ package miniaudio
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "lib/miniaudio.lib" }
-when ODIN_OS == "linux" { foreign import lib "lib/miniaudio.a" }
+when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" }
+when ODIN_OS == .Linux { foreign import lib "lib/miniaudio.a" }
/************************************************************************************************************************************************************
diff --git a/vendor/portmidi/portmidi.odin b/vendor/portmidi/portmidi.odin
index 08f78150c..40fd18b8b 100644
--- a/vendor/portmidi/portmidi.odin
+++ b/vendor/portmidi/portmidi.odin
@@ -3,7 +3,7 @@ package portmidi
import "core:c"
import "core:strings"
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import lib {
"portmidi_s.lib",
"system:Winmm.lib",
diff --git a/vendor/portmidi/util.odin b/vendor/portmidi/util.odin
index d02142bd0..ca2e1f4ca 100644
--- a/vendor/portmidi/util.odin
+++ b/vendor/portmidi/util.odin
@@ -7,7 +7,7 @@ package portmidi
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "portmidi_s.lib" }
+when ODIN_OS == .Windows { foreign import lib "portmidi_s.lib" }
Queue :: distinct rawptr
diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin
index fb4d7dd92..0c8248683 100644
--- a/vendor/raylib/raylib.odin
+++ b/vendor/raylib/raylib.odin
@@ -91,7 +91,7 @@ MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
#assert(size_of(rune) == size_of(c.int))
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import lib {
"raylib.lib",
"system:Winmm.lib",
@@ -100,14 +100,14 @@ when ODIN_OS == "windows" {
"system:Shell32.lib",
}
}
-when ODIN_OS == "linux" {
+when ODIN_OS == .Linux {
foreign import lib {
"linux/libraylib.a",
"system:dl",
"system:pthread",
}
}
-when ODIN_OS == "darwin" { foreign import lib "macos/libraylib.a" }
+when ODIN_OS == .Darwin { foreign import lib "macos/libraylib.a" }
VERSION :: "4.0"
diff --git a/vendor/raylib/rlgl.odin b/vendor/raylib/rlgl.odin
index 8f91486c1..936a34765 100644
--- a/vendor/raylib/rlgl.odin
+++ b/vendor/raylib/rlgl.odin
@@ -2,7 +2,7 @@ package raylib
import "core:c"
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
foreign import lib {
"raylib.lib",
"system:Winmm.lib",
@@ -11,8 +11,8 @@ when ODIN_OS == "windows" {
"system:Shell32.lib",
}
}
-when ODIN_OS == "linux" { foreign import lib "linux/libraylib.a" }
-when ODIN_OS == "darwin" { foreign import lib "macos/libraylib.a" }
+when ODIN_OS == .Linux { foreign import lib "linux/libraylib.a" }
+when ODIN_OS == .Darwin { foreign import lib "macos/libraylib.a" }
GRAPHICS_API_OPENGL_11 :: false
GRAPHICS_API_OPENGL_21 :: true
diff --git a/vendor/sdl2/image/sdl_image.odin b/vendor/sdl2/image/sdl_image.odin
index 1dbe048ed..30a7db6a8 100644
--- a/vendor/sdl2/image/sdl_image.odin
+++ b/vendor/sdl2/image/sdl_image.odin
@@ -3,10 +3,10 @@ package sdl2_image
import "core:c"
import SDL ".."
-when ODIN_OS == "windows" { foreign import lib "SDL2_image.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2_image" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2_image" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_image" }
+when ODIN_OS == .Windows { foreign import lib "SDL2_image.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2_image" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2_image" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_image" }
bool :: SDL.bool
diff --git a/vendor/sdl2/mixer/sdl_mixer.odin b/vendor/sdl2/mixer/sdl_mixer.odin
index 90334d91a..7fa3f216f 100644
--- a/vendor/sdl2/mixer/sdl_mixer.odin
+++ b/vendor/sdl2/mixer/sdl_mixer.odin
@@ -3,10 +3,10 @@ package sdl2_mixer
import "core:c"
import SDL ".."
-when ODIN_OS == "windows" { foreign import lib "SDL2_mixer.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2_mixer" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2_mixer" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_mixer" }
+when ODIN_OS == .Windows { foreign import lib "SDL2_mixer.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2_mixer" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2_mixer" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_mixer" }
MAJOR_VERSION :: 2
diff --git a/vendor/sdl2/net/sdl_net.odin b/vendor/sdl2/net/sdl_net.odin
index 49671764a..b3e2c2e62 100644
--- a/vendor/sdl2/net/sdl_net.odin
+++ b/vendor/sdl2/net/sdl_net.odin
@@ -3,10 +3,10 @@ package sdl2_net
import "core:c"
import SDL ".."
-when ODIN_OS == "windows" { foreign import lib "SDL2_net.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2_net" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2_net" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_net" }
+when ODIN_OS == .Windows { foreign import lib "SDL2_net.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2_net" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2_net" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_net" }
bool :: SDL.bool
diff --git a/vendor/sdl2/sdl2.odin b/vendor/sdl2/sdl2.odin
index 4781483f7..e36c002dd 100644
--- a/vendor/sdl2/sdl2.odin
+++ b/vendor/sdl2/sdl2.odin
@@ -25,10 +25,10 @@ package sdl2
import "core:c"
import "core:intrinsics"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
version :: struct {
major: u8, /**< major version */
diff --git a/vendor/sdl2/sdl_audio.odin b/vendor/sdl2/sdl_audio.odin
index 2c5b7fedb..a03031165 100644
--- a/vendor/sdl2/sdl_audio.odin
+++ b/vendor/sdl2/sdl_audio.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
/**
* \brief Audio format flags.
diff --git a/vendor/sdl2/sdl_blendmode.odin b/vendor/sdl2/sdl_blendmode.odin
index 3fb7c2e83..525cf0f38 100644
--- a/vendor/sdl2/sdl_blendmode.odin
+++ b/vendor/sdl2/sdl_blendmode.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
/**
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
diff --git a/vendor/sdl2/sdl_cpuinfo.odin b/vendor/sdl2/sdl_cpuinfo.odin
index 5fe5cf16c..7d2e681fe 100644
--- a/vendor/sdl2/sdl_cpuinfo.odin
+++ b/vendor/sdl2/sdl_cpuinfo.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
/* This is a guess for the cacheline size used for padding.
* Most x86 processors have a 64 byte cache line.
diff --git a/vendor/sdl2/sdl_events.odin b/vendor/sdl2/sdl_events.odin
index 535269656..3f58b51c3 100644
--- a/vendor/sdl2/sdl_events.odin
+++ b/vendor/sdl2/sdl_events.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
RELEASED :: 0
PRESSED :: 1
diff --git a/vendor/sdl2/sdl_gamecontroller.odin b/vendor/sdl2/sdl_gamecontroller.odin
index 747cd1af6..9fef6b1ab 100644
--- a/vendor/sdl2/sdl_gamecontroller.odin
+++ b/vendor/sdl2/sdl_gamecontroller.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
GameController :: struct {}
diff --git a/vendor/sdl2/sdl_gesture_haptic.odin b/vendor/sdl2/sdl_gesture_haptic.odin
index 0d257a525..1c8616e99 100644
--- a/vendor/sdl2/sdl_gesture_haptic.odin
+++ b/vendor/sdl2/sdl_gesture_haptic.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
// Gesture
diff --git a/vendor/sdl2/sdl_hints.odin b/vendor/sdl2/sdl_hints.odin
index b5793bb02..a84e5a090 100644
--- a/vendor/sdl2/sdl_hints.odin
+++ b/vendor/sdl2/sdl_hints.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
HINT_ACCELEROMETER_AS_JOYSTICK :: "SDL_ACCELEROMETER_AS_JOYSTICK"
HINT_ALLOW_ALT_TAB_WHILE_GRABBED :: "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
diff --git a/vendor/sdl2/sdl_joystick.odin b/vendor/sdl2/sdl_joystick.odin
index d2bb624b7..1178eae24 100644
--- a/vendor/sdl2/sdl_joystick.odin
+++ b/vendor/sdl2/sdl_joystick.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
Joystick :: struct {}
diff --git a/vendor/sdl2/sdl_keyboard.odin b/vendor/sdl2/sdl_keyboard.odin
index 86112863a..a68c644ab 100644
--- a/vendor/sdl2/sdl_keyboard.odin
+++ b/vendor/sdl2/sdl_keyboard.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
Keysym :: struct {
scancode: Scancode, /**< SDL physical key code - see ::SDL_Scancode for details */
diff --git a/vendor/sdl2/sdl_log.odin b/vendor/sdl2/sdl_log.odin
index b9f8a8d7d..d42d82b77 100644
--- a/vendor/sdl2/sdl_log.odin
+++ b/vendor/sdl2/sdl_log.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
MAX_LOG_MESSAGE :: 4096
diff --git a/vendor/sdl2/sdl_messagebox.odin b/vendor/sdl2/sdl_messagebox.odin
index d8a07c1e2..c66cc4911 100644
--- a/vendor/sdl2/sdl_messagebox.odin
+++ b/vendor/sdl2/sdl_messagebox.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
MessageBoxFlag :: enum u32 {
_ = 0,
diff --git a/vendor/sdl2/sdl_metal.odin b/vendor/sdl2/sdl_metal.odin
index 87a0313ef..953c6d45f 100644
--- a/vendor/sdl2/sdl_metal.odin
+++ b/vendor/sdl2/sdl_metal.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
MetalView :: distinct rawptr
diff --git a/vendor/sdl2/sdl_mouse.odin b/vendor/sdl2/sdl_mouse.odin
index d667addc8..5ca8d9b5e 100644
--- a/vendor/sdl2/sdl_mouse.odin
+++ b/vendor/sdl2/sdl_mouse.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
Cursor :: struct {}
diff --git a/vendor/sdl2/sdl_mutex.odin b/vendor/sdl2/sdl_mutex.odin
index 80d62f7c8..6b9c96319 100644
--- a/vendor/sdl2/sdl_mutex.odin
+++ b/vendor/sdl2/sdl_mutex.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
MUTEX_TIMEDOUT :: 1
MUTEX_MAXWAIT :: ~u32(0)
diff --git a/vendor/sdl2/sdl_pixels.odin b/vendor/sdl2/sdl_pixels.odin
index 22f6db440..3cd2da5f4 100644
--- a/vendor/sdl2/sdl_pixels.odin
+++ b/vendor/sdl2/sdl_pixels.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
ALPHA_OPAQUE :: 255
ALPHA_TRANSPARENT :: 0
diff --git a/vendor/sdl2/sdl_rect.odin b/vendor/sdl2/sdl_rect.odin
index 929897c26..b0d6242be 100644
--- a/vendor/sdl2/sdl_rect.odin
+++ b/vendor/sdl2/sdl_rect.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
Point :: struct {
x: c.int,
diff --git a/vendor/sdl2/sdl_render.odin b/vendor/sdl2/sdl_render.odin
index c92fd3eda..435c40570 100644
--- a/vendor/sdl2/sdl_render.odin
+++ b/vendor/sdl2/sdl_render.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
RendererFlag :: enum u32 {
SOFTWARE = 0, /**< The renderer is a software fallback */
diff --git a/vendor/sdl2/sdl_rwops.odin b/vendor/sdl2/sdl_rwops.odin
index 590815c90..3bee66290 100644
--- a/vendor/sdl2/sdl_rwops.odin
+++ b/vendor/sdl2/sdl_rwops.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
/* RWops Types */
RWOPS_UNKNOWN :: 0 /**< Unknown stream type */
diff --git a/vendor/sdl2/sdl_stdinc.odin b/vendor/sdl2/sdl_stdinc.odin
index bf098a591..9bd5df4da 100644
--- a/vendor/sdl2/sdl_stdinc.odin
+++ b/vendor/sdl2/sdl_stdinc.odin
@@ -5,10 +5,10 @@ import "core:intrinsics"
import "core:runtime"
_, _ :: intrinsics, runtime
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
bool :: distinct b32
#assert(size_of(bool) == size_of(c.int))
diff --git a/vendor/sdl2/sdl_surface.odin b/vendor/sdl2/sdl_surface.odin
index c0b20be63..e5a5da7ef 100644
--- a/vendor/sdl2/sdl_surface.odin
+++ b/vendor/sdl2/sdl_surface.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
SWSURFACE :: 0 /**< Just here for compatibility */
PREALLOC :: 0x00000001 /**< Surface uses preallocated memory */
diff --git a/vendor/sdl2/sdl_system.odin b/vendor/sdl2/sdl_system.odin
index 31f1b590b..89ae4c707 100644
--- a/vendor/sdl2/sdl_system.odin
+++ b/vendor/sdl2/sdl_system.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
// General
@(default_calling_convention="c", link_prefix="SDL_")
diff --git a/vendor/sdl2/sdl_syswm.odin b/vendor/sdl2/sdl_syswm.odin
index e374e72b7..37da1d298 100644
--- a/vendor/sdl2/sdl_syswm.odin
+++ b/vendor/sdl2/sdl_syswm.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
SYSWM_TYPE :: enum c.int {
UNKNOWN,
diff --git a/vendor/sdl2/sdl_thread.odin b/vendor/sdl2/sdl_thread.odin
index cbaf3ac00..98354438b 100644
--- a/vendor/sdl2/sdl_thread.odin
+++ b/vendor/sdl2/sdl_thread.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
Thread :: struct {}
diff --git a/vendor/sdl2/sdl_timer.odin b/vendor/sdl2/sdl_timer.odin
index 5b26c7346..357fdd437 100644
--- a/vendor/sdl2/sdl_timer.odin
+++ b/vendor/sdl2/sdl_timer.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
TimerCallback :: proc "c" (interval: u32, param: rawptr) -> u32
TimerID :: distinct c.int
diff --git a/vendor/sdl2/sdl_touch.odin b/vendor/sdl2/sdl_touch.odin
index c393b74ef..d90939cb9 100644
--- a/vendor/sdl2/sdl_touch.odin
+++ b/vendor/sdl2/sdl_touch.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
TouchID :: distinct i64
FingerID :: distinct i64
diff --git a/vendor/sdl2/sdl_video.odin b/vendor/sdl2/sdl_video.odin
index 97a134739..01aaee1e7 100644
--- a/vendor/sdl2/sdl_video.odin
+++ b/vendor/sdl2/sdl_video.odin
@@ -2,10 +2,10 @@ package sdl2
import "core:c"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
DisplayMode :: struct {
format: u32, /**< pixel format */
diff --git a/vendor/sdl2/sdl_vulkan.odin b/vendor/sdl2/sdl_vulkan.odin
index 97a41bacf..66b054524 100644
--- a/vendor/sdl2/sdl_vulkan.odin
+++ b/vendor/sdl2/sdl_vulkan.odin
@@ -3,10 +3,10 @@ package sdl2
import "core:c"
import vk "vendor:vulkan"
-when ODIN_OS == "windows" { foreign import lib "SDL2.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2" }
+when ODIN_OS == .Windows { foreign import lib "SDL2.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2" }
VkInstance :: vk.Instance
VkSurfaceKHR :: vk.SurfaceKHR
diff --git a/vendor/sdl2/ttf/sdl_ttf.odin b/vendor/sdl2/ttf/sdl_ttf.odin
index 6b41f07c2..20db09729 100644
--- a/vendor/sdl2/ttf/sdl_ttf.odin
+++ b/vendor/sdl2/ttf/sdl_ttf.odin
@@ -3,10 +3,10 @@ package sdl2_ttf
import "core:c"
import SDL ".."
-when ODIN_OS == "windows" { foreign import lib "SDL2_ttf.lib" }
-when ODIN_OS == "linux" { foreign import lib "system:SDL2_ttf" }
-when ODIN_OS == "darwin" { foreign import lib "system:SDL2_ttf" }
-when ODIN_OS == "freebsd" { foreign import lib "system:SDL2_ttf" }
+when ODIN_OS == .Windows { foreign import lib "SDL2_ttf.lib" }
+when ODIN_OS == .Linux { foreign import lib "system:SDL2_ttf" }
+when ODIN_OS == .Darwin { foreign import lib "system:SDL2_ttf" }
+when ODIN_OS == .FreeBSD { foreign import lib "system:SDL2_ttf" }
bool :: SDL.bool
diff --git a/vendor/stb/image/stb_image.odin b/vendor/stb/image/stb_image.odin
index 9e72760ab..8a3582792 100644
--- a/vendor/stb/image/stb_image.odin
+++ b/vendor/stb/image/stb_image.odin
@@ -4,8 +4,8 @@ import c "core:c/libc"
#assert(size_of(c.int) == size_of(b32))
-when ODIN_OS == "windows" { foreign import stbi "../lib/stb_image.lib" }
-when ODIN_OS == "linux" { foreign import stbi "../lib/stb_image.a" }
+when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib" }
+when ODIN_OS == .Linux { foreign import stbi "../lib/stb_image.a" }
#assert(size_of(b32) == size_of(c.int))
diff --git a/vendor/stb/image/stb_image_resize.odin b/vendor/stb/image/stb_image_resize.odin
index bee29a15e..65bf3e4a9 100644
--- a/vendor/stb/image/stb_image_resize.odin
+++ b/vendor/stb/image/stb_image_resize.odin
@@ -2,8 +2,8 @@ package stb_image
import c "core:c/libc"
-when ODIN_OS == "windows" { foreign import lib "../lib/stb_image_resize.lib" }
-when ODIN_OS == "linux" { foreign import lib "../lib/stb_image_resize.a" }
+when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib" }
+when ODIN_OS == .Linux { foreign import lib "../lib/stb_image_resize.a" }
//////////////////////////////////////////////////////////////////////////////
//
diff --git a/vendor/stb/image/stb_image_write.odin b/vendor/stb/image/stb_image_write.odin
index 1f0cfce85..67f4299fa 100644
--- a/vendor/stb/image/stb_image_write.odin
+++ b/vendor/stb/image/stb_image_write.odin
@@ -2,8 +2,8 @@ package stb_image
import c "core:c/libc"
-when ODIN_OS == "windows" { foreign import stbiw "../lib/stb_image_write.lib" }
-when ODIN_OS == "linux" { foreign import stbiw "../lib/stb_image_write.a" }
+when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib" }
+when ODIN_OS == .Linux { foreign import stbiw "../lib/stb_image_write.a" }
write_func :: proc "c" (ctx: rawptr, data: rawptr, size: c.int)
diff --git a/vendor/stb/rect_pack/stb_rect_pack.odin b/vendor/stb/rect_pack/stb_rect_pack.odin
index 4142a73ec..f84f1cedc 100644
--- a/vendor/stb/rect_pack/stb_rect_pack.odin
+++ b/vendor/stb/rect_pack/stb_rect_pack.odin
@@ -4,8 +4,8 @@ import c "core:c/libc"
#assert(size_of(b32) == size_of(c.int))
-when ODIN_OS == "windows" { foreign import lib "../lib/stb_rect_pack.lib" }
-when ODIN_OS == "linux" { foreign import lib "../lib/stb_rect_pack.a" }
+when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib" }
+when ODIN_OS == .Linux { foreign import lib "../lib/stb_rect_pack.a" }
Coord :: distinct c.int
_MAXVAL :: max(Coord)
diff --git a/vendor/stb/truetype/stb_truetype.odin b/vendor/stb/truetype/stb_truetype.odin
index 3abb187c2..cf4af15e9 100644
--- a/vendor/stb/truetype/stb_truetype.odin
+++ b/vendor/stb/truetype/stb_truetype.odin
@@ -3,8 +3,8 @@ package stb_truetype
import c "core:c"
import stbrp "vendor:stb/rect_pack"
-when ODIN_OS == "windows" { foreign import stbtt "../lib/stb_truetype.lib" }
-when ODIN_OS == "linux" { foreign import stbtt "../lib/stb_truetype.a" }
+when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib" }
+when ODIN_OS == .Linux { foreign import stbtt "../lib/stb_truetype.a" }
///////////////////////////////////////////////////////////////////////////////
diff --git a/vendor/stb/vorbis/stb_vorbis.odin b/vendor/stb/vorbis/stb_vorbis.odin
index 7ec248df5..f35b58e04 100644
--- a/vendor/stb/vorbis/stb_vorbis.odin
+++ b/vendor/stb/vorbis/stb_vorbis.odin
@@ -3,8 +3,8 @@ package stb_vorbis
import c "core:c/libc"
-when ODIN_OS == "windows" { foreign import lib "../lib/stb_vorbis.lib" }
-when ODIN_OS == "linux" { foreign import lib "../lib/stb_vorbis.a" }
+when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib" }
+when ODIN_OS == .Linux { foreign import lib "../lib/stb_vorbis.a" }
diff --git a/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py b/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py
index 1525f4e15..e7fb234c8 100644
--- a/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py
+++ b/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py
@@ -591,7 +591,7 @@ MAX_GLOBAL_PRIORITY_SIZE_EXT :: 16
f.write("""
import "core:c"
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
\timport win32 "core:sys/windows"
\tHINSTANCE :: win32.HINSTANCE
diff --git a/vendor/vulkan/structs.odin b/vendor/vulkan/structs.odin
index 4d90a53fa..3c655a4fa 100644
--- a/vendor/vulkan/structs.odin
+++ b/vendor/vulkan/structs.odin
@@ -5,7 +5,7 @@ package vulkan
import "core:c"
-when ODIN_OS == "windows" {
+when ODIN_OS == .Windows {
import win32 "core:sys/windows"
HINSTANCE :: win32.HINSTANCE