mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 00:28:49 +00:00
Use proc "c" calling convention in NS Foundation package
This commit is contained in:
+6
-6
@@ -20,30 +20,30 @@ Enumerator :: struct($T: typeid) where intrinsics.type_is_pointer(T), intrinsics
|
||||
|
||||
|
||||
@(objc_type=FastEnumeration, objc_name="alloc", objc_is_class_method=true)
|
||||
FastEnumeration_alloc :: proc() -> ^FastEnumeration {
|
||||
FastEnumeration_alloc :: proc "c" () -> ^FastEnumeration {
|
||||
return msgSend(^FastEnumeration, FastEnumeration, "alloc")
|
||||
}
|
||||
|
||||
@(objc_type=FastEnumeration, objc_name="init")
|
||||
FastEnumeration_init :: proc(self: ^FastEnumeration) -> ^FastEnumeration {
|
||||
FastEnumeration_init :: proc "c" (self: ^FastEnumeration) -> ^FastEnumeration {
|
||||
return msgSend(^FastEnumeration, self, "init")
|
||||
}
|
||||
|
||||
|
||||
@(objc_type=FastEnumeration, objc_name="countByEnumerating")
|
||||
FastEnumeration_countByEnumerating :: proc(self: ^FastEnumeration, state: ^FastEnumerationState, buffer: [^]^Object, len: UInteger) -> UInteger {
|
||||
FastEnumeration_countByEnumerating :: proc "c" (self: ^FastEnumeration, state: ^FastEnumerationState, buffer: [^]^Object, len: UInteger) -> UInteger {
|
||||
return msgSend(UInteger, self, "countByEnumeratingWithState:objects:count:", state, buffer, len)
|
||||
}
|
||||
|
||||
Enumerator_nextObject :: proc(self: ^$E/Enumerator($T)) -> T {
|
||||
Enumerator_nextObject :: proc "c" (self: ^$E/Enumerator($T)) -> T {
|
||||
return msgSend(T, self, "nextObject")
|
||||
}
|
||||
|
||||
Enumerator_allObjects :: proc(self: ^$E/Enumerator($T)) -> (all: ^Array) {
|
||||
Enumerator_allObjects :: proc "c" (self: ^$E/Enumerator($T)) -> (all: ^Array) {
|
||||
return msgSend(type_of(all), self, "allObjects")
|
||||
}
|
||||
|
||||
Enumerator_iterator :: proc(self: ^$E/Enumerator($T)) -> (obj: T, ok: bool) {
|
||||
Enumerator_iterator :: proc "contextless" (self: ^$E/Enumerator($T)) -> (obj: T, ok: bool) {
|
||||
obj = msgSend(T, self, "nextObject")
|
||||
ok = obj != nil
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user