File tree Expand file tree Collapse file tree 1 file changed +27
-10
lines changed Expand file tree Collapse file tree 1 file changed +27
-10
lines changed Original file line number Diff line number Diff line change 88
99#ifdef _WIN32
1010#include < Windows.h>
11+ #include < stdlib.h>
1112#endif
1213
13- // Cadabra frontend with GTK+ interface (using gtkmm).
14+ // Cadabra frontend with GTK+ interface (using gtkmm).
1415// Makes use of the client classes in the client_server directory.
1516
1617int main (int argc, char **argv)
17- {
18+ {
1819 try {
1920 auto application = Cadabra::create (argc, argv);
2021 const int status = application->run ();
2122 return status;
22- }
23- catch (Glib::Error& er) {
23+ }
24+ catch (Glib::Error& er) {
2425 std::cerr << er.what () << std::endl;
2526 return -1 ;
26- }
27- catch (std::exception& ex) {
28- std::cerr << ex.what () << std::endl;
29- }
3027 }
28+ catch (std::exception& ex) {
29+ std::cerr << ex.what () << std::endl;
30+ }
31+ }
3132
3233#if defined(_WIN32) && defined(NDEBUG)
3334int WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
3435{
35- main (0 , 0 );
36+ try {
37+ auto application = Cadabra::create (__argc, __argv);
38+ const int status = application->run ();
39+ return status;
40+ }
41+ catch (Glib::Error& er) {
42+ Gtk::MessageDialog (er.what ()).run ();
43+ return -1 ;
44+ }
45+ catch (std::exception& ex) {
46+ Gtk::MessageDialog (ex.what ()).run ();
47+ return -1 ;
48+ }
49+ catch (...) {
50+ Gtk::MessageDialog (" An unknown error occured :(" ).run ();
51+ throw ;
52+ }
3653}
37- #endif
54+ #endif
You can’t perform that action at this time.
0 commit comments