From b659b90576cf88100b52ca6ab9270d84af7e579b Mon Sep 17 00:00:00 2001 From: koekeishiya Date: Tue, 1 Dec 2020 13:12:04 +0100 Subject: #154 fix build on Apple Silicon --- src/notify.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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); -- cgit v1.2.3