From 010c91931c89fe2b6271a7395a0cb17279c704a2 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 6 Oct 2013 19:50:30 +0300 Subject: [PATCH] Fix the cocoa error dialog so that it actually compiles --- source/graphics/cocoa/cocoaerrordialog.h | 14 ++++++++++++++ .../cocoa/{errordialog.m => cocoaerrordialog.m} | 5 +---- source/graphics/cocoa/errordialog.cpp | 7 +++++-- 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 source/graphics/cocoa/cocoaerrordialog.h rename source/graphics/cocoa/{errordialog.m => cocoaerrordialog.m} (81%) diff --git a/source/graphics/cocoa/cocoaerrordialog.h b/source/graphics/cocoa/cocoaerrordialog.h new file mode 100644 index 0000000..7a03018 --- /dev/null +++ b/source/graphics/cocoa/cocoaerrordialog.h @@ -0,0 +1,14 @@ +#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 diff --git a/source/graphics/cocoa/errordialog.m b/source/graphics/cocoa/cocoaerrordialog.m similarity index 81% rename from source/graphics/cocoa/errordialog.m rename to source/graphics/cocoa/cocoaerrordialog.m index 2b6b3c6..eb82d57 100644 --- a/source/graphics/cocoa/errordialog.m +++ b/source/graphics/cocoa/cocoaerrordialog.m @@ -1,8 +1,6 @@ #import #import - -// The function gets incorrect linkage without a prototype -void run_alert(const char *, const char *); +#include "cocoaerrordialog.h" void run_alert(const char *type, const char *what) { @@ -13,4 +11,3 @@ void run_alert(const char *type, const char *what) informativeTextWithFormat:@"%@", message]; [alert runModal]; } - diff --git a/source/graphics/cocoa/errordialog.cpp b/source/graphics/cocoa/errordialog.cpp index ec44461..e923586 100644 --- a/source/graphics/cocoa/errordialog.cpp +++ b/source/graphics/cocoa/errordialog.cpp @@ -1,14 +1,17 @@ +#include +#include +#include +#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()); -- 2.45.2