Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif

#ifdef DEBUG
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */
#define D(a) \
{ \
if (opt.debug) { \
printf("%-12s +%-4u %-20s : ",__FILE__,__LINE__,__func__); \
printf a; \
fflush(stdout); \
} \
}
#else /* __STDC_VERSION__ >= 199901L */
#ifdef __GNUC__
#define D(a) \
{ \
Expand All @@ -58,6 +68,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
} \
}
#endif /* __GNUC__ */
#endif /* __STDC_VERSION__ >= 199901L */
#else /* DEBUG */
#define D(a)
#endif /* DEBUG */
Expand Down