libdballe 9.6
core/trace.h
Go to the documentation of this file.
1
4#ifndef DBALLE_CORE_TRACE_H
5#define DBALLE_CORE_TRACE_H
6
7/*
8 * Include this file if you want to enable trace functions in a source
9 *
10 * The trace functions are not compiled unless you #define TRACE_SOURCE
11 * before including this header.
12 */
13#ifdef TRACE_SOURCE
14#include <cstdio>
15// Output a trace message
16#define TRACE(...) fprintf(stderr, __VA_ARGS__)
17// Prefix a block of code to compile only if trace is enabled
18#define IFTRACE if (1)
19#else
20#define TRACE(...) do { } while (0)
21#define IFTRACE if (0)
22#endif
23
24#endif