7 #if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__==0x0530)
12 #elif defined(GLib_GLIBC) || defined(GLib_BSD)
17 #elif defined(GLib_SOLARIS)
18 int _matherr(
struct __math_exception* e){
22 #elif defined(GLib_CYGWIN)
23 int matherr(
struct __exception *e){
27 #elif defined(GLib_MACOSX)
41 void WrNotify(
const char* CaptionCStr,
const char* NotifyCStr){
42 #if defined(__CONSOLE__) || defined(_CONSOLE)
43 printf(
"*** %s: %s\n", CaptionCStr, NotifyCStr);
45 MessageBox(NULL, NotifyCStr, CaptionCStr, MB_OK);
51 char* FNm=
new char[MxFNmLen];
if (FNm==NULL){
return;}
52 int FNmLen=GetModuleFileName(NULL, FNm, MxFNmLen);
if (FNmLen==0){
return;}
53 FNm[FNmLen++]=
'.'; FNm[FNmLen++]=
'E'; FNm[FNmLen++]=
'r'; FNm[FNmLen++]=
'r';
54 FNm[FNmLen++]=char(0);
55 time_t Time=time(NULL);
56 FILE* fOut=fopen(FNm,
"a+b");
if (fOut==NULL){
return;}
57 fprintf(fOut,
"--------\r\n%s\r\n%s%s\r\n--------\r\n",
58 FNm, ctime(&Time), MsgCStr);
64 void PrintBacktrace() {
73 size = backtrace(array, 20);
74 backtrace_symbols_fd(array, size, 1);
89 const char* MsgCStr,
const char* ReasonCStr,
90 const char* CondCStr,
const char* FNm,
const int& LnN){
91 char ReasonMsgCStr[1000];
99 if (ReasonCStr==NULL){ReasonMsgCStr[0]=0;}
100 else {sprintf(ReasonMsgCStr,
" [Reason:'%s']", ReasonCStr);}
102 char FullMsgCStr[1000];
105 sprintf(FullMsgCStr,
"Execution stopped%s!", ReasonMsgCStr);
107 sprintf(FullMsgCStr,
"Execution stopped: %s%s, file %s, line %d",
108 CondCStr, ReasonMsgCStr, FNm, LnN);
112 sprintf(FullMsgCStr,
"%s\nExecution stopped!", MsgCStr);
114 sprintf(FullMsgCStr,
"Message: %s%s\nExecution stopped: %s, file %s, line %d",
115 MsgCStr, ReasonMsgCStr, CondCStr, FNm, LnN);
121 #if defined(SW_NOABORT)
void ExeStop(const char *MsgCStr, const char *ReasonCStr, const char *CondCStr, const char *FNm, const int &LnN)
void ErrNotify(const char *NotifyCStr)
int _matherr(struct _exception *e)
static void Throw(const TStr &MsgStr)
void SaveToErrLog(const char *MsgCStr)
static TOnExeStopF OnExeStopF
static bool IsOnExeStopF()
void WrNotify(const char *CaptionCStr, const char *NotifyCStr)
bool(* TOnExeStopF)(char *MsgCStr)
static TOnExeStopF GetOnExeStopF()