mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Remove the use of import within when
This commit is contained in:
@@ -4,13 +4,16 @@
|
|||||||
//+build !js
|
//+build !js
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
// TODO(bill): reimplement these procedures in the os_specific stuff
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
|
when ODIN_DEFAULT_TO_NIL_ALLOCATOR {
|
||||||
|
_ :: os
|
||||||
|
|
||||||
// mem.nil_allocator reimplementation
|
// mem.nil_allocator reimplementation
|
||||||
default_allocator_proc :: nil_allocator_proc
|
default_allocator_proc :: nil_allocator_proc
|
||||||
default_allocator :: nil_allocator
|
default_allocator :: nil_allocator
|
||||||
} else {
|
} else {
|
||||||
// TODO(bill): reimplement these procedures in the os_specific stuff
|
|
||||||
import "core:os"
|
|
||||||
|
|
||||||
default_allocator_proc :: os.heap_allocator_proc
|
default_allocator_proc :: os.heap_allocator_proc
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -5,7 +5,9 @@ package vendor_gl
|
|||||||
import "core:os"
|
import "core:os"
|
||||||
import "core:fmt"
|
import "core:fmt"
|
||||||
import "core:strings"
|
import "core:strings"
|
||||||
|
import "core:runtime"
|
||||||
_ :: fmt
|
_ :: fmt
|
||||||
|
_ :: runtime
|
||||||
|
|
||||||
Shader_Type :: enum i32 {
|
Shader_Type :: enum i32 {
|
||||||
NONE = 0x0000,
|
NONE = 0x0000,
|
||||||
@@ -47,8 +49,6 @@ get_last_error_message :: proc() -> (compile_message: string, compile_type: Shad
|
|||||||
// except for calling differently named GL functions
|
// except for calling differently named GL functions
|
||||||
// it's a bit ugly looking, but meh
|
// it's a bit ugly looking, but meh
|
||||||
when GL_DEBUG {
|
when GL_DEBUG {
|
||||||
import "core:runtime"
|
|
||||||
|
|
||||||
@private
|
@private
|
||||||
check_error :: proc(
|
check_error :: proc(
|
||||||
id: u32, type: Shader_Type, status: u32,
|
id: u32, type: Shader_Type, status: u32,
|
||||||
|
|||||||
Vendored
+5
-3
@@ -2,6 +2,11 @@ package vendor_gl
|
|||||||
|
|
||||||
#assert(size_of(bool) == size_of(u8))
|
#assert(size_of(bool) == size_of(u8))
|
||||||
|
|
||||||
|
import "core:runtime"
|
||||||
|
import "core:fmt"
|
||||||
|
_ :: runtime
|
||||||
|
_ :: fmt
|
||||||
|
|
||||||
when !GL_DEBUG {
|
when !GL_DEBUG {
|
||||||
// VERSION_1_0
|
// VERSION_1_0
|
||||||
CullFace :: proc "c" (mode: u32) { impl_CullFace(mode) }
|
CullFace :: proc "c" (mode: u32) { impl_CullFace(mode) }
|
||||||
@@ -756,9 +761,6 @@ when !GL_DEBUG {
|
|||||||
MultiDrawElementsIndirectCount :: proc "c" (mode: i32, type: i32, indirect: [^]DrawElementsIndirectCommand, drawcount: i32, maxdrawcount, stride: i32) { impl_MultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride) }
|
MultiDrawElementsIndirectCount :: proc "c" (mode: i32, type: i32, indirect: [^]DrawElementsIndirectCommand, drawcount: i32, maxdrawcount, stride: i32) { impl_MultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride) }
|
||||||
PolygonOffsetClamp :: proc "c" (factor, units, clamp: f32) { impl_PolygonOffsetClamp(factor, units, clamp) }
|
PolygonOffsetClamp :: proc "c" (factor, units, clamp: f32) { impl_PolygonOffsetClamp(factor, units, clamp) }
|
||||||
} else {
|
} else {
|
||||||
import "core:runtime"
|
|
||||||
import "core:fmt"
|
|
||||||
|
|
||||||
debug_helper :: proc"c"(from_loc: runtime.Source_Code_Location, num_ret: int, args: ..any, loc := #caller_location) {
|
debug_helper :: proc"c"(from_loc: runtime.Source_Code_Location, num_ret: int, args: ..any, loc := #caller_location) {
|
||||||
context = runtime.default_context()
|
context = runtime.default_context()
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -1,9 +1,8 @@
|
|||||||
package objc_Foundation
|
package objc_Foundation
|
||||||
|
|
||||||
|
import "core:c"
|
||||||
|
_ :: c
|
||||||
when ODIN_OS == .Darwin {
|
when ODIN_OS == .Darwin {
|
||||||
import "core:c"
|
|
||||||
_ :: c
|
|
||||||
|
|
||||||
#assert(size_of(c.long) == size_of(int))
|
#assert(size_of(c.long) == size_of(int))
|
||||||
#assert(size_of(c.ulong) == size_of(uint))
|
#assert(size_of(c.ulong) == size_of(uint))
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-24
@@ -276,30 +276,6 @@ thread_priority :: enum c.int {
|
|||||||
realtime = 1,
|
realtime = 1,
|
||||||
default = 0,
|
default = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
when ODIN_OS == .Windows {
|
|
||||||
thread :: distinct rawptr
|
|
||||||
mutex :: distinct rawptr
|
|
||||||
event :: distinct rawptr
|
|
||||||
semaphore :: distinct rawptr
|
|
||||||
} else {
|
|
||||||
import "core:sys/unix"
|
|
||||||
|
|
||||||
thread :: unix.pthread_t
|
|
||||||
mutex :: unix.pthread_mutex_t
|
|
||||||
event :: struct {
|
|
||||||
value: u32,
|
|
||||||
lock: unix.pthread_mutex_t,
|
|
||||||
cond: unix.pthread_cond_t,
|
|
||||||
}
|
|
||||||
semaphore :: struct {
|
|
||||||
value: c.int,
|
|
||||||
lock: unix.pthread_mutex_t,
|
|
||||||
cond: unix.pthread_cond_t,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* NO_THREADING */
|
} /* NO_THREADING */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+17
@@ -0,0 +1,17 @@
|
|||||||
|
//+build !windows
|
||||||
|
package miniaudio
|
||||||
|
|
||||||
|
import "core:sys/unix"
|
||||||
|
|
||||||
|
thread :: unix.pthread_t
|
||||||
|
mutex :: unix.pthread_mutex_t
|
||||||
|
event :: struct {
|
||||||
|
value: u32,
|
||||||
|
lock: unix.pthread_mutex_t,
|
||||||
|
cond: unix.pthread_cond_t,
|
||||||
|
}
|
||||||
|
semaphore :: struct {
|
||||||
|
value: c.int,
|
||||||
|
lock: unix.pthread_mutex_t,
|
||||||
|
cond: unix.pthread_cond_t,
|
||||||
|
}
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
package miniaudio
|
||||||
|
|
||||||
|
thread :: distinct rawptr
|
||||||
|
mutex :: distinct rawptr
|
||||||
|
event :: distinct rawptr
|
||||||
|
semaphore :: distinct rawptr
|
||||||
Vendored
+2
-3
@@ -87,9 +87,8 @@ import "core:mem"
|
|||||||
import "core:strings"
|
import "core:strings"
|
||||||
|
|
||||||
USE_LINALG :: #config(RAYLIB_USE_LINALG, true)
|
USE_LINALG :: #config(RAYLIB_USE_LINALG, true)
|
||||||
when USE_LINALG {
|
import "core:math/linalg"
|
||||||
import "core:math/linalg"
|
_ :: linalg
|
||||||
}
|
|
||||||
|
|
||||||
MAX_TEXTFORMAT_BUFFERS :: #config(RAYLIB_MAX_TEXTFORMAT_BUFFERS, 4)
|
MAX_TEXTFORMAT_BUFFERS :: #config(RAYLIB_MAX_TEXTFORMAT_BUFFERS, 4)
|
||||||
MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
|
MAX_TEXT_BUFFER_LENGTH :: #config(RAYLIB_MAX_TEXT_BUFFER_LENGTH, 1024)
|
||||||
|
|||||||
+2
-2
@@ -829,9 +829,9 @@ with open("../structs.odin", 'w', encoding='utf-8') as f:
|
|||||||
f.write("""
|
f.write("""
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
|
import win32 "core:sys/windows"
|
||||||
|
_ :: win32
|
||||||
when ODIN_OS == .Windows {
|
when ODIN_OS == .Windows {
|
||||||
\timport win32 "core:sys/windows"
|
|
||||||
|
|
||||||
\tHINSTANCE :: win32.HINSTANCE
|
\tHINSTANCE :: win32.HINSTANCE
|
||||||
\tHWND :: win32.HWND
|
\tHWND :: win32.HWND
|
||||||
\tHMONITOR :: win32.HMONITOR
|
\tHMONITOR :: win32.HMONITOR
|
||||||
|
|||||||
Vendored
+2
-2
@@ -5,9 +5,9 @@ package vulkan
|
|||||||
|
|
||||||
import "core:c"
|
import "core:c"
|
||||||
|
|
||||||
|
import win32 "core:sys/windows"
|
||||||
|
_ :: win32
|
||||||
when ODIN_OS == .Windows {
|
when ODIN_OS == .Windows {
|
||||||
import win32 "core:sys/windows"
|
|
||||||
|
|
||||||
HINSTANCE :: win32.HINSTANCE
|
HINSTANCE :: win32.HINSTANCE
|
||||||
HWND :: win32.HWND
|
HWND :: win32.HWND
|
||||||
HMONITOR :: win32.HMONITOR
|
HMONITOR :: win32.HMONITOR
|
||||||
|
|||||||
Reference in New Issue
Block a user