6 #include "mainerror.inc"
10 // This is needed for errors which are too verbose to fit in the
13 // Once created, it accumulates errors in a listbox until it's closed.
15 // Macro to enable the simplest possible error output
16 //#define eprintf(format, ...) {char error_string[1024]; sprintf(sprintf(error_string, "%s: " format, __PRETTY_FUNCTION__, ## __VA_ARGS__); MainError::show_error(error_string); }
17 // We have to use longer version if we want to gettext error messages
18 #define eprintf(...) {char error_string[1024]; sprintf(error_string, "%s: ", __PRETTY_FUNCTION__); sprintf(error_string + strlen(error_string), __VA_ARGS__); MainError::show_error(error_string); }
22 class MainErrorGUI
: public BC_Window
25 MainErrorGUI(MWindow
*mwindow
, MainError
*thread
, int x
, int y
);
28 void create_objects();
29 int resize_event(int w
, int h
);
38 class MainError
: public BC_DialogThread
41 MainError(MWindow
*mwindow
);
44 friend class MainErrorGUI
;
49 // Display error message to command line or GUI, depending on what exists.
50 static void show_error(char *string
);
54 void show_error_local(char *string
);
56 // Split errors into multiple lines based on carriage returns.
57 void append_error(char *string
);
61 ArrayList
<BC_ListBoxItem
*> errors
;
64 // Main error dialog. Won't exist if no GUI.
65 static MainError
*main_error
;