libmya
0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
src
include
debug.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <stdio.h>
4
5
#include "
colors.h
"
6
7
#define DPRINTF(level, fmt, ...) fprintf(stderr, "[" C_BLUE "DEBUG " C_GREEN #level C_NORMAL "] " fmt, __VA_ARGS__)
8
9
#if DLEVEL >= 1
10
# define DPRINTF1(fmt, ...) DPRINTF(1, fmt, __VA_ARGS__)
11
# define DEBUG_IF(expr, code) \
12
if (expr) { \
13
code; \
14
}
15
#else
16
# define DPRINTF1(fmt, ...)
17
# define DEBUG_IF(expr, code)
18
#endif
19
20
#if DLEVEL >= 2
21
# define DPRINTF2(fmt, ...) DPRINTF(2, fmt, __VA_ARGS__)
22
#else
23
# define DPRINTF2(fmt, ...)
24
#endif
25
26
#if DLEVEL >= 3
27
# define DPRINTF3(fmt, ...) DPRINTF(3, fmt, __VA_ARGS__)
28
#else
29
# define DPRINTF3(fmt, ...)
30
#endif
colors.h
Generated by
1.13.2