CVaList support on MacOS aarch64.

This commit is contained in:
Christoffer Lerno
2025-09-09 01:05:20 +02:00
parent 3caaf0a3e8
commit 0d8f9520e9
2 changed files with 12 additions and 0 deletions

View File

@@ -59,3 +59,14 @@ macro typeid unsigned_int_from_bitsize(usz $bitsize) @private
$default: $error("Invalid bitsize");
$endswitch
}
module std::core::cinterop @if(env::MACOS && env::AARCH64);
typedef CVaList = void*;
macro CVaList.next(&self, $Type)
{
void *ptr = mem::aligned_pointer((void*)*self, max($Type.alignof, 8));
defer *self = (CVaList)(ptr + 1);
return *($Type*)ptr;
}