| iMatix home page | << | < | > | >> |
![]() Version 1.91 |
#include "sflsyst.h" void sys_assert (const char *File, unsigned Line)
Displays an 'assertion failed' message and aborts the program. This function is required by prelude.h if you compile with the DEBUG symbol.
{ # if (defined (__WINDOWS__) && !defined (_CONSOLE)) static char buffer [LINE_MAX]; /* Formatted error message */ MSG msg; Bool quit; int rc; /* MessageBox return code */ sprintf (buffer, "Module %s, line %u", File, Line); /* If WM_QUIT is in the queue the message box won't show */ quit = PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE); rc = MessageBox (NULL, buffer, "Assertion failed!", MB_TASKMODAL | MB_ICONHAND | MB_ABORTRETRYIGNORE); if (quit) PostQuitMessage (msg.wParam); if (rc != IDABORT) return; # else fflush (stdout); fprintf (stderr, "\nAssertion failed: %s, line %u\n", File, Line); fflush (stderr); # endif abort (); }
| << | < | > | >> |
![]() |