summaryrefslogtreecommitdiff
path: root/qstd/plat.h
blob: 27521fa85b2121bef873d7fbea568f20572f8e26 (plain) (blame)
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
31
32
#ifndef plat_h
#define plat_h

#ifdef assert
#undef assert
#endif

#ifdef DEBUG
#define assert(expr) \
	imp_assert( \
		expr, \
		#expr, \
		__FILE__, \
		__LINE__ \
	)
#else
#define assert(expr)
#endif

int imp_assert(
	int val,
	const char* expr,
	const char* file,
	int line
);

void print(const char* fmt, ...);
void print_err(const char* fmt, ...);
void print_war(const char* fmt, ...);
void pbreak(int code);

#endif