8 __attribute__ ((visibility("default")))
11 CustomPanic(const char *format
, va_list args
) noexcept
13 // default weak implementation
14 // to be overridden by WinPort implementation if process is hosting it
18 void FN_NORETURN
Panic(const char *format
, ...) noexcept
20 va_list args
, args4log
, args4cust
;
21 va_start(args
, format
);
22 va_copy(args4log
, args
);
23 va_copy(args4cust
, args
);
24 vfprintf(stderr
, format
, args
);
28 FILE *flog
= fopen(InMyConfig("crash.log").c_str(), "a");
30 time_t now
= time(NULL
);
32 localtime_r(&now
, &t
);
33 fprintf(flog
, "[%u/%02u/%02u %02u:%02u] ",
34 t
.tm_year
+ 1900, t
.tm_mon
+ 1, t
.tm_mday
, t
.tm_hour
, t
.tm_min
);
35 vfprintf(flog
, format
, args4log
);
41 CustomPanic(format
, args4cust
);
42 // --- CustomPanic doesn't return --- va_end(args4cust);