--- /dev/null
+#ifndef MSP_GRAPHICS_COCOAERRORDIALOG_H_
+#define MSP_GRAPHICS_COCOAERRORDIALOG_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void run_alert(const char *, const char *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+#import <Foundation/NSString.h>
+#import <AppKit/NSAlert.h>
+#include "cocoaerrordialog.h"
+
+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];
+}
+#include <typeinfo>
+#include <msp/core/application.h>
+#include <msp/debug/demangle.h>
+#include "cocoaerrordialog.h"
#include "errordialog.h"
using namespace std;
-extern "C" void run_alert(const char *, const char *);
-
namespace Msp {
namespace Graphics {
bool ErrorDialog::report_uncaught_exception(const exception &e) const
{
+ (void)display;
if(Application::get_data())
{
string type = Debug::demangle(typeid(e).name());
+++ /dev/null
-#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];
-}
-