Disable debugging functionality if DEBUG flag is not set
This commit is contained in:
parent
9c7b65b74c
commit
31ebc6fc35
3 changed files with 15 additions and 1 deletions
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -12,6 +12,7 @@
|
||||||
"system_error": "c",
|
"system_error": "c",
|
||||||
"array": "c",
|
"array": "c",
|
||||||
"string_view": "c",
|
"string_view": "c",
|
||||||
"packet.h": "c"
|
"packet.h": "c",
|
||||||
|
"debug.h": "c"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#if DEBUG
|
||||||
|
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
@ -28,3 +30,5 @@ void hexdump(char *data, size_t len) {
|
||||||
i += 16;
|
i += 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
|
@ -3,6 +3,15 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
|
||||||
void hexdump(char *data, size_t len);
|
void hexdump(char *data, size_t len);
|
||||||
|
|
||||||
|
#else /* DEBUG */
|
||||||
|
|
||||||
|
#define hexdump(_data, _len) /* */
|
||||||
|
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
|
||||||
#endif /* debug_h__included */
|
#endif /* debug_h__included */
|
||||||
|
|
Loading…
Reference in a new issue