diff --git a/core/mem/alloc.odin b/core/mem/alloc.odin index 6c9664917..2685dd5b5 100644 --- a/core/mem/alloc.odin +++ b/core/mem/alloc.odin @@ -59,7 +59,7 @@ free_slice :: proc(array: $T/[]$E, loc := #caller_location) { free_ptr(raw_data(array), loc); } free_map :: proc(m: $T/map[$K]$V, loc := #caller_location) { - raw := transmute(raw.Map)m; + raw := transmute(Raw_Map)m; free_dynamic_array(raw.hashes, loc); free_ptr(raw.entries.data, loc); } diff --git a/core/opengl/opengl.odin b/core/opengl/opengl.odin index 29845fba2..453ab98fc 100644 --- a/core/opengl/opengl.odin +++ b/core/opengl/opengl.odin @@ -1,15 +1,16 @@ package opengl -when ODIN_OS == "windows" { +import "core:os" +import "core:mem" + +when os.OS == "windows" { foreign import lib "system:opengl32.lib" import win32 "core:sys/win32" -} else when ODIN_OS == "linux" { +} else when os.OS == "linux" { foreign import lib "system:gl" } -export "core:opengl_constants.odin" - -#assert(ODIN_OS != "osx"); +#assert(os.OS != "osx"); @(default_calling_convention="c", link_prefix="gl") foreign lib { @@ -48,7 +49,7 @@ get_gl_proc_address :: proc(name: string) -> rawptr { name = name[..len(name)-1]; } // NOTE(bill): null terminated - assert((&name[0] + len(name))^ == 0); + assert(mem.ptr_offset(&name[0], cast(uintptr)len(name))^ == 0); res := win32.get_gl_proc_address(cstring(&name[0])); if res == nil { res = win32.get_proc_address(_libgl, cstring(&name[0]));