diff --git a/.vscode/settings.json b/.vscode/settings.json index 97a143c..0d36bd5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,7 @@ "system_error": "c", "array": "c", "string_view": "c", - "packet.h": "c" + "packet.h": "c", + "debug.h": "c" } } diff --git a/src/debug.c b/src/debug.c index 85ce8e7..94501fa 100644 --- a/src/debug.c +++ b/src/debug.c @@ -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 */ diff --git a/src/debug.h b/src/debug.h index c6a0e68..2088c6b 100644 --- a/src/debug.h +++ b/src/debug.h @@ -3,6 +3,15 @@ #include +#if DEBUG + void hexdump(char *data, size_t len); +#else /* DEBUG */ + +#define hexdump(_data, _len) /* */ + +#endif /* DEBUG */ + + #endif /* debug_h__included */