diff options
author | koekeishiya <aasvi93@hotmail.com> | 2020-12-01 13:12:04 +0100 |
---|---|---|
committer | koekeishiya <aasvi93@hotmail.com> | 2020-12-01 13:12:04 +0100 |
commit | b659b90576cf88100b52ca6ab9270d84af7e579b (patch) | |
tree | ede2fd0693ede105423078e66d533edbb54f6c63 /src/notify.c | |
parent | 02ec66eddb85a5bea62412022ef6cad57a7280c3 (diff) | |
download | skhd-b659b90576cf88100b52ca6ab9270d84af7e579b.tar.gz skhd-b659b90576cf88100b52ca6ab9270d84af7e579b.zip |
#154 fix build on Apple Silicon
Diffstat (limited to 'src/notify.c')
-rw-r--r-- | src/notify.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/notify.c b/src/notify.c index 04c416e..0505159 100644 --- a/src/notify.c +++ b/src/notify.c @@ -15,13 +15,13 @@ void notify(const char *subtitle, const char *format, ...) CFStringRef subtitle_ref = CFStringCreateWithCString(NULL, subtitle, kCFStringEncodingUTF8); CFStringRef message_ref = CFStringCreateWithFormatAndArguments(NULL, NULL, format_ref, args); - void *center = objc_msgSend((void *) objc_getClass("NSUserNotificationCenter"), sel_registerName("defaultUserNotificationCenter")); - void *notification = objc_msgSend((void *) objc_getClass("NSUserNotification"), sel_registerName("alloc"), sel_registerName("init")); + void *center = ((void * (*)(void *, SEL))objc_msgSend)((void *) objc_getClass("NSUserNotificationCenter"), sel_registerName("defaultUserNotificationCenter")); + void *notification = ((void * (*)(void *, SEL, SEL))objc_msgSend)((void *) objc_getClass("NSUserNotification"), sel_registerName("alloc"), sel_registerName("init")); - objc_msgSend(notification, sel_registerName("setTitle:"), CFSTR("skhd")); - objc_msgSend(notification, sel_registerName("setSubtitle:"), subtitle_ref); - objc_msgSend(notification, sel_registerName("setInformativeText:"), message_ref); - objc_msgSend(center, sel_registerName("deliverNotification:"), notification); + ((void (*)(void *, SEL, CFStringRef))objc_msgSend)(notification, sel_registerName("setTitle:"), CFSTR("skhd")); + ((void (*)(void *, SEL, CFStringRef))objc_msgSend)(notification, sel_registerName("setSubtitle:"), subtitle_ref); + ((void (*)(void *, SEL, CFStringRef))objc_msgSend)(notification, sel_registerName("setInformativeText:"), message_ref); + ((void (*)(void *, SEL, void *))objc_msgSend)(center, sel_registerName("deliverNotification:"), notification); CFRelease(message_ref); CFRelease(subtitle_ref); |