forked from dismantl/linux-injector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.h
More file actions
24 lines (21 loc) · 620 Bytes
/
debug.h
File metadata and controls
24 lines (21 loc) · 620 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
//=====================================================//
// Copyright (c) 2015, Dan Staples (https://disman.tl) //
//=====================================================//
#include <stdio.h>
#include <errno.h>
#include <string.h>
#define CHECK(A,M,...) \
do { \
if (!(A)) { \
fprintf(stderr, \
"(%s:%d: error: %d [%s]) " M "\n", \
__FILE__, \
__LINE__, \
errno, \
errno == 0 ? "None" : strerror(errno), \
##__VA_ARGS__); \
errno = 0; \
goto error; \
} \
} while(0)
#define dprintf(M,...) printf("[*] [%s] " M "\n", __FUNCTION__, ##__VA_ARGS__)