- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpanic.cpp
More file actions
Latest commit
30 lines (22 loc) · 409 Bytes
/
Copy pathpanic.cpp
File metadata and controls
30 lines (22 loc) · 409 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<cstdio>
#include<cstdlib>
#include<stdarg.h>
#ifdef ANDROID_NDK
#include<android/log.h>
#endif
#include"panic.h"
void
panic(constchar *fmt, ...)
{
char buf[512];
va_list ap;
va_start(ap, fmt);
vsprintf(buf, fmt, ap);
va_end(ap);
#ifndef ANDROID_NDK
fprintf(stderr, "FATAL: %s\n", buf);
#else
__android_log_print(ANDROID_LOG_INFO, "kpuzzle", "FATAL: %s", buf);
#endif
exit(1);
}