mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 18:30:06 +00:00
Merge branch 'master' of https://github.com/odin-lang/Odin
This commit is contained in:
@@ -21,8 +21,7 @@ hash_string :: proc(algorithm: Algorithm, data: string, allocator := context.all
|
||||
// in a newly allocated slice.
|
||||
hash_bytes :: proc(algorithm: Algorithm, data: []byte, allocator := context.allocator) -> []byte {
|
||||
dst := make([]byte, DIGEST_SIZES[algorithm], allocator)
|
||||
hash_bytes_to_buffer(algorithm, data, dst)
|
||||
return dst
|
||||
return hash_bytes_to_buffer(algorithm, data, dst)
|
||||
}
|
||||
|
||||
// hash_string_to_buffer will hash the given input and assign the
|
||||
@@ -46,7 +45,7 @@ hash_bytes_to_buffer :: proc(algorithm: Algorithm, data, hash: []byte) -> []byte
|
||||
update(&ctx, data)
|
||||
final(&ctx, hash)
|
||||
|
||||
return hash
|
||||
return hash[:DIGEST_SIZES[algorithm]]
|
||||
}
|
||||
|
||||
// hash_stream will incrementally fully consume a stream, and return the
|
||||
|
||||
@@ -967,8 +967,8 @@ _processor_core_count :: proc() -> int {
|
||||
@(private, require_results)
|
||||
_alloc_command_line_arguments :: proc() -> []string {
|
||||
res := make([]string, len(runtime.args__))
|
||||
for arg, i in runtime.args__ {
|
||||
res[i] = string(arg)
|
||||
for _, i in res {
|
||||
res[i] = string(runtime.args__[i])
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -1100,8 +1100,8 @@ _processor_core_count :: proc() -> int {
|
||||
@(private, require_results)
|
||||
_alloc_command_line_arguments :: proc() -> []string {
|
||||
res := make([]string, len(runtime.args__))
|
||||
for arg, i in runtime.args__ {
|
||||
res[i] = string(arg)
|
||||
for _, i in res {
|
||||
res[i] = string(runtime.args__[i])
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -1017,8 +1017,8 @@ _processor_core_count :: proc() -> int {
|
||||
@(private, require_results)
|
||||
_alloc_command_line_arguments :: proc() -> []string {
|
||||
res := make([]string, len(runtime.args__))
|
||||
for arg, i in runtime.args__ {
|
||||
res[i] = string(arg)
|
||||
for _, i in res {
|
||||
res[i] = string(runtime.args__[i])
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -917,8 +917,8 @@ _processor_core_count :: proc() -> int {
|
||||
@(private, require_results)
|
||||
_alloc_command_line_arguments :: proc() -> []string {
|
||||
res := make([]string, len(runtime.args__))
|
||||
for arg, i in runtime.args__ {
|
||||
res[i] = string(arg)
|
||||
for _, i in res {
|
||||
res[i] = string(runtime.args__[i])
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#+build !wasi
|
||||
#+build !js
|
||||
package filepath
|
||||
|
||||
import "core:os"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#+build !wasi
|
||||
#+build !js
|
||||
package filepath
|
||||
|
||||
import "core:os"
|
||||
|
||||
@@ -3,23 +3,13 @@ package darwin
|
||||
// #define OS_WAIT_ON_ADDR_AVAILABILITY \
|
||||
// __API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4))
|
||||
when ODIN_OS == .Darwin {
|
||||
|
||||
when ODIN_PLATFORM_SUBTARGET == .iOS && ODIN_MINIMUM_OS_VERSION >= 17_04_00 {
|
||||
WAIT_ON_ADDRESS_AVAILABLE :: true
|
||||
} else when ODIN_MINIMUM_OS_VERSION >= 14_04_00 {
|
||||
WAIT_ON_ADDRESS_AVAILABLE :: true
|
||||
when ODIN_PLATFORM_SUBTARGET_IOS {
|
||||
WAIT_ON_ADDRESS_AVAILABLE :: ODIN_MINIMUM_OS_VERSION >= 17_04_00
|
||||
ULOCK_WAIT_2_AVAILABLE :: ODIN_MINIMUM_OS_VERSION >= 14_00_00
|
||||
} else {
|
||||
WAIT_ON_ADDRESS_AVAILABLE :: false
|
||||
WAIT_ON_ADDRESS_AVAILABLE :: ODIN_MINIMUM_OS_VERSION >= 14_04_00
|
||||
ULOCK_WAIT_2_AVAILABLE :: ODIN_MINIMUM_OS_VERSION >= 11_00_00
|
||||
}
|
||||
|
||||
when ODIN_PLATFORM_SUBTARGET == .iOS && ODIN_MINIMUM_OS_VERSION >= 14_00_00 {
|
||||
ULOCK_WAIT_2_AVAILABLE :: true
|
||||
} else when ODIN_MINIMUM_OS_VERSION >= 11_00_00 {
|
||||
ULOCK_WAIT_2_AVAILABLE :: true
|
||||
} else {
|
||||
ULOCK_WAIT_2_AVAILABLE :: false
|
||||
}
|
||||
|
||||
} else {
|
||||
WAIT_ON_ADDRESS_AVAILABLE :: false
|
||||
ULOCK_WAIT_2_AVAILABLE :: false
|
||||
|
||||
@@ -28,7 +28,7 @@ init_platform :: proc() {
|
||||
|
||||
macos_version = {int(version.majorVersion), int(version.minorVersion), int(version.patchVersion)}
|
||||
|
||||
when ODIN_PLATFORM_SUBTARGET == .iOS {
|
||||
when ODIN_PLATFORM_SUBTARGET_IOS {
|
||||
os_version.platform = .iOS
|
||||
ws(&b, "iOS")
|
||||
} else {
|
||||
|
||||
@@ -25,11 +25,12 @@ COINIT :: enum DWORD {
|
||||
SPEED_OVER_MEMORY = 0x8,
|
||||
}
|
||||
|
||||
IUnknown_UUID_STRING :: "00000000-0000-0000-C000-000000000046"
|
||||
IUnknown_UUID := &IID{0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
|
||||
IUnknownVtbl :: IUnknown_VTable
|
||||
IUnknown :: struct {
|
||||
using _iunknown_vtable: ^IUnknown_VTable,
|
||||
}
|
||||
|
||||
IUnknownVtbl :: IUnknown_VTable
|
||||
IUnknown_VTable :: struct {
|
||||
QueryInterface: proc "system" (This: ^IUnknown, riid: REFIID, ppvObject: ^rawptr) -> HRESULT,
|
||||
AddRef: proc "system" (This: ^IUnknown) -> ULONG,
|
||||
|
||||
Reference in New Issue
Block a user