| extern int mingw_app_type; |
| static cpy_wstr (char *buf, const wchar_t *src, size_t max) |
| while (max > 0 && *src != 0) |
| _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line) |
| char *msgbuf = (char *) malloc (8192); |
| char fn[MAX_PATH + 1], msg[MAX_PATH + 1], iFile[MAX_PATH + 1]; |
| cpy_wstr (msg, _Message, MAX_PATH); |
| cpy_wstr (iFile, _File, MAX_PATH); |
| strcpy (iFile, "<unknown>"); |
| if (! GetModuleFileName (NULL, fn, MAX_PATH)) |
| strcpy (fn, "<unknown>"); |
| sprintf (msgbuf, "Assertation failed!\n\nProgram: %s\nFile: %s, Line %u\n\nExpression: %s", |
| fprintf (stderr, "%s\n", msgbuf); |
| nCode = MessageBoxA (NULL, msgbuf, "MinGW Runtime Assertation", MB_ABORTRETRYIGNORE| |
| MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); |