aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkoekeishiya <aasvi93@hotmail.com>2020-12-01 13:12:04 +0100
committerkoekeishiya <aasvi93@hotmail.com>2020-12-01 13:12:04 +0100
commitb659b90576cf88100b52ca6ab9270d84af7e579b (patch)
treeede2fd0693ede105423078e66d533edbb54f6c63
parent02ec66eddb85a5bea62412022ef6cad57a7280c3 (diff)
downloadskhd-b659b90576cf88100b52ca6ab9270d84af7e579b.tar.gz
skhd-b659b90576cf88100b52ca6ab9270d84af7e579b.zip
#154 fix build on Apple Silicon
-rw-r--r--src/notify.c12
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);