Skip to content
Snippets Groups Projects
Commit 1ed18eb7 authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

Put files only used for debugging under #if (DEBUGLEVEL > 0)

parent da685091
No related branches found
No related tags found
1 merge request!29Adapt to C standard GNU89 with GCC extensions
......@@ -16,6 +16,7 @@
* @brief compression/decompression debugging printing functions
*/
#if (DEBUGLEVEL > 0)
#ifndef ICU_ASW
# include <stdio.h>
......@@ -85,3 +86,5 @@ void cmp_debug_print_impl(const char *fmt, ...)
cmp_debug_puts(print_buffer);
}
#endif /* (DEBUGLEVEL > 0) */
......@@ -23,19 +23,23 @@
/* DEBUGLEVEL should be externally defined, usually via the compiler command
* line. Its value must be a numeric value. */
#ifndef DEBUGLEVEL
# ifdef DEBUG
# define DEBUGLEVEL 1
# else
# define DEBUGLEVEL 0
# endif
#endif
#define PRINT_BUFFER_SIZE 256
__extension__
#if (defined(DEBUG) || DEBUGLEVEL > 0)
#if (DEBUGLEVEL > 0)
# define debug_print(...) cmp_debug_print_impl(__VA_ARGS__)
void cmp_debug_print_impl(const char *fmt, ...);
#else
# define debug_print(...) do {} while (0)
#endif
void cmp_debug_print_impl(const char *fmt, ...);
#endif /* CMP_DEBUG_H */
......@@ -27,6 +27,8 @@
* reentrant!
*/
#if (DEBUGLEVEL > 0)
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
......@@ -883,3 +885,4 @@ int my_vsnprintf(char* buffer, size_t count, const char* format, va_list va)
return _vsnprintf(_out_buffer, buffer, count, format, va);
}
#endif /* (DEBUGLEVEL > 0) */
......@@ -20,6 +20,8 @@
#ifndef VSNPRINTF_H
#define VSNPRINTF_H
#if (DEBUGLEVEL > 0)
int my_vsnprintf(char* buffer, size_t count, const char* format, va_list va);
#endif
#endif /* VSNPRINTF_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment