Commit e3612088 authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

Make debug() work only when DEBUG is defined

This way it works with features (such as extra structure fields)
that depend on DEBUG being defined.
parent 5c031a46
......@@ -5,22 +5,22 @@
/**
* Prints a debug message to stdout (unless NDEBUG is defined).
* Prints a debug message to stdout (if DEBUG is defined).
*
* This is a compile-time feature.
*
* @param args arguments to pass to fprintf()
*/
#ifdef NDEBUG
# define debug(args...) do {} while (0)
#else
#ifdef DEBUG
# define debug(args...) fprintf (stdout, args); fflush (stdout)
#else
# define debug(args...) do {} while (0)
#endif
/**
* Prints a debug message to stdout prefixed with the name of
* the function and the source code line (unless NDEBUG is defined).
* the function and the source code line (if DEBUG is defined).
*
* This is a compile-time feature.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment