150 // signal handler, which will cause the usual bomb box with GDB diagnostics. |
148 // signal handler, which will cause the usual bomb box with GDB diagnostics. |
151 // Said prompt will embed the assertion failure information. |
149 // Said prompt will embed the assertion failure information. |
152 // |
150 // |
153 void assertionFailure (const char* file, int line, const char* funcname, const char* expr) |
151 void assertionFailure (const char* file, int line, const char* funcname, const char* expr) |
154 { |
152 { |
155 String errmsg = format ( |
153 #ifdef __unix__ |
|
154 g_assertionFailure = format ("%1:%2: %3: %4", file, line, funcname, expr); |
|
155 #else |
|
156 bombBox (format ( |
156 "<p><b>File</b>: <tt>%1</tt><br />" |
157 "<p><b>File</b>: <tt>%1</tt><br />" |
157 "<b>Line</b>: <tt>%2</tt><br />" |
158 "<b>Line</b>: <tt>%2</tt><br />" |
158 "<b>Function:</b> <tt>%3</tt></p>" |
159 "<b>Function:</b> <tt>%3</tt></p>" |
159 "<p>Assertion <b><tt>`%4'</tt></b> failed.</p>", |
160 "<p>Assertion <b><tt>`%4'</tt></b> failed.</p>", |
160 file, line, funcname, expr); |
161 file, line, funcname, expr)); |
161 |
|
162 g_assertionFailure = errmsg; |
|
163 |
|
164 #ifndef __unix__ |
|
165 bombBox (errmsg); |
|
166 #endif |
162 #endif |
167 |
163 |
168 abort(); |
164 abort(); |
169 } |
165 } |