-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.h
41 lines (33 loc) · 1.34 KB
/
util.h
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
33
34
35
36
37
38
39
40
41
#ifndef UTIL_H
#define UTIL_H
#include <stdio.h>
#include "fixes.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <string.h>
#define FATAL(...) \
{ \
fprintf(stderr, "Error(%s:%d): ", __FILE__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
exit(1); \
}
#ifndef ASSERT
#define ASSERT(exp, ...) \
{ \
if (!(exp)) { \
fprintf(stderr, "Assert Failed (%s:%d): ", __FILE__, __LINE__); \
fprintf(stderr, __VA_ARGS__); \
exit(1); \
} \
}
#endif
void wa_debug(char *c, ...);
void wa_info(char *c, ...);
void wa_warn(char *c, ...);
void wa_error(char *c, ...);
void wa_trace(char *c, ...);
bool should_trace(void);
#endif