Implementes the block ABI.2010.3.16 natively via the objc_block intrinsic and the Objc_Block builtin type.

See: https://clang.llvm.org/docs/Block-ABI-Apple.html
This commit is contained in:
Harold Brenes
2025-08-06 20:27:31 -04:00
parent 09a1e170bc
commit 9d8e15b3af
9 changed files with 644 additions and 2 deletions
+5
View File
@@ -5,6 +5,11 @@ import "base:intrinsics"
@builtin
Maybe :: union($T: typeid) {T}
/*
Represents an Objective-C block with a given procedure signature T
*/
@builtin
Objc_Block :: struct($T: typeid) where intrinsics.type_is_proc(T) { using _: intrinsics.objc_object }
/*
Recovers the containing/parent struct from a pointer to one of its fields.