mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add NSApplicationTerminateReply and registerClassPair to objc stdlib
The missing registerClassPair function is required to register a class and make it active with objc after allocating with the existing allocateClassPair function.
This commit is contained in:
@@ -70,6 +70,7 @@ extern fn bool class_addMethod(ObjcClass cls, ObjcSelector name, void* imp, ZStr
|
||||
extern fn ObjcIvar getInstanceVariable(ObjcId id, ZString name, void* outValue) @cname("object_getInstanceVariable");
|
||||
extern fn ObjcIvar setInstanceVariable(ObjcId id, ZString name, void* value) @cname("object_setInstanceVariable");
|
||||
extern fn ObjcClass allocateClassPair(ObjcClass cls, ZString name, uint extraBytes) @cname("objc_allocateClassPair");
|
||||
extern fn void registerClassPair(ObjcClass cls) @cname("objc_registerClassPair");
|
||||
|
||||
module std::os::macos::objc::ns @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework");
|
||||
import std::os::macos::cf;
|
||||
@@ -407,3 +408,9 @@ enum NSStatusItemLength : const inline CGFloat
|
||||
SQUARE = -2.0
|
||||
}
|
||||
|
||||
enum NSApplicationTerminateReply : const inline NSUInteger
|
||||
{
|
||||
CANCEL = 0,
|
||||
NOW = 1,
|
||||
LATER = 2,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user