Commit 35ba1763 authored by Lubomir Bulej's avatar Lubomir Bulej
Browse files

Make debug() work only when DEBUG is defined

parent 284b8b89
......@@ -21,22 +21,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