diff --git a/lib/std/core/cinterop.c3 b/lib/std/core/cinterop.c3 index 7888115d0..f20c6990f 100644 --- a/lib/std/core/cinterop.c3 +++ b/lib/std/core/cinterop.c3 @@ -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; +} + diff --git a/releasenotes.md b/releasenotes.md index 16687dfb6..fb39ed3e4 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -26,6 +26,7 @@ `path::public_share_directory`, `path::templates_directory`, `path::saved_games_directory`, `path::music_directory`, `path::downloads_directory`. - Add `LinkedList` array_view to support `[]` and `foreach`/`foreach_r`. #2438 - Make `LinkedList` printable and add `==` operator. #2438 +- CVaList support on MacOS aarch64. ## 0.7.5 Change list