mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Core Foundation and Security vendor libraries.
This commit is contained in:
@@ -0,0 +1,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))
|
||||
}
|
||||
Reference in New Issue
Block a user