+#import <Foundation/NSString.h>
+#import <AppKit/NSAlert.h>
+
+// The function gets incorrect linkage without a prototype
+void run_alert(const char *, const char *);
+
+void run_alert(const char *type, const char *what)
+{
+ NSString *message = [[[NSString stringWithUTF8String:type] stringByAppendingString:@": "]
+ stringByAppendingString:[NSString stringWithUTF8String:what]];
+ NSAlert *alert = [NSAlert alertWithMessageText:@"Uncaught exception"
+ defaultButton:nil alternateButton:nil otherButton:nil
+ informativeTextWithFormat:@"%@", message];
+ [alert runModal];
+}
+