blob: 7335f087b945cd032f6ca4544f21715653d5ee2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
package CoreFoundation
foreign import CoreFoundation "system:CoreFoundation.framework"
TypeID :: distinct uint
OptionFlags :: distinct uint
HashCode :: distinct uint
Index :: distinct int
TypeRef :: distinct rawptr
Range :: struct {
location: Index,
length: Index,
}
foreign CoreFoundation {
// Releases a Core Foundation object.
CFRelease :: proc(cf: TypeRef) ---
}
// Releases a Core Foundation object.
Release :: proc {
ReleaseObject,
ReleaseString,
}
ReleaseObject :: #force_inline proc(cf: TypeRef) {
CFRelease(cf)
}
// Releases a Core Foundation string.
ReleaseString :: #force_inline proc(theString: String) {
CFRelease(TypeRef(theString))
}
|