Disable debugging functionality if DEBUG flag is not set

This commit is contained in:
Johannes Schriewer 2018-07-28 02:40:48 +02:00
parent 9c7b65b74c
commit 31ebc6fc35
3 changed files with 15 additions and 1 deletions

View file

@ -12,6 +12,7 @@
"system_error": "c",
"array": "c",
"string_view": "c",
"packet.h": "c"
"packet.h": "c",
"debug.h": "c"
}
}

View file

@ -1,3 +1,5 @@
#if DEBUG
#include "stdio.h"
#include "debug.h"
@ -28,3 +30,5 @@ void hexdump(char *data, size_t len) {
i += 16;
}
}
#endif /* DEBUG */

View file

@ -3,6 +3,15 @@
#include <stdlib.h>
#if DEBUG
void hexdump(char *data, size_t len);
#else /* DEBUG */
#define hexdump(_data, _len) /* */
#endif /* DEBUG */
#endif /* debug_h__included */