diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-04 19:22:33 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-03-04 19:22:33 +0100 |
| commit | 2d9f5709d74992e0cd485099a5a8cdf12178e80d (patch) | |
| tree | aebd707471ee0d6a62334bfd69f5681299f692cb /builtin | |
| parent | 75ab88b2c81c164b851c4e064f4da1c11b2a5679 (diff) | |
Add support for builtin symbols.
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/builtin.odin | 75 |
1 files changed, 63 insertions, 12 deletions
diff --git a/builtin/builtin.odin b/builtin/builtin.odin index 009a7eb..b1cabed 100644 --- a/builtin/builtin.odin +++ b/builtin/builtin.odin @@ -1,17 +1,17 @@ package ols_builtin // Procedures -len :: proc(array: Array_Type) -> int --- -cap :: proc(array: Array_Type) -> int --- +@builtin len :: proc(array: Array_Type) -> int --- +@builtin cap :: proc(array: Array_Type) -> int --- size_of :: proc($T: typeid) -> int --- -align_of :: proc($T: typeid) -> int --- -offset_of :: proc($T: typeid) -> uintptr --- -type_of :: proc(x: expr) -> type --- -type_info_of :: proc($T: typeid) -> ^runtime.Type_Info --- -typeid_of :: proc($T: typeid) -> typeid --- +@builtin align_of :: proc($T: typeid) -> int --- +@builtin offset_of :: proc($T: typeid) -> uintptr --- +@builtin type_of :: proc(x: expr) -> type --- +@builtin type_info_of :: proc($T: typeid) -> ^runtime.Type_Info --- +@builtin typeid_of :: proc($T: typeid) -> typeid --- -swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- +@builtin swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- complex :: proc(real, imag: Float) -> Complex_Type --- quaternion :: proc(real, imag, jmag, kmag: Float) -> Quaternion_Type --- @@ -21,7 +21,58 @@ jmag :: proc(value: Quaternion) -> Float --- kmag :: proc(value: Quaternion) -> Float --- conj :: proc(value: Complex_Or_Quaternion) -> Complex_Or_Quaternion --- -min :: proc(values: ..T) -> T --- -max :: proc(values: ..T) -> T --- -abs :: proc(value: T) -> T --- -clamp :: proc(value, minimum, maximum: T) -> T ---
\ No newline at end of file +@builtin min :: proc(values: ..T) -> T --- +@builtin max :: proc(values: ..T) -> T --- +@builtin abs :: proc(value: T) -> T --- +@builtin clamp :: proc(value, minimum, maximum: T) -> T --- + +/* + This is interally from the compiler +*/ + +Odin_OS_Type :: enum int { + Unknown, + Windows, + Darwin, + Linux, + Essence, + FreeBSD, + WASI, + JS, + Freestanding, +} + +@builtin +ODIN_OS: Odin_OS_Type + +Odin_Arch_Type :: enum int { + Unknown, + amd64, + i386, + arm64, + wasm32, + wasm64, +} + +@builtin +ODIN_ARCH: Odin_Arch_Type + +Odin_Build_Mode_Type :: enum int { + Executable, + Dynamic, + Object, + Assembly, + LLVM_IR, +} + +@builtin +ODIN_BUILD_MODE: Odin_Build_Mode_Type + +Odin_Endian_Type :: enum int { + Unknown, + Little, + Big, +} + +@builtin +ODIN_ENDIAN: Odin_Endian_Type
\ No newline at end of file |