summaryrefslogtreecommitdiff
path: root/debug.h
diff options
context:
space:
mode:
authorMichael Clark <michael@metaparadigm.com>2007-10-25 02:26:00 +0000
committerMichael Clark <michael@metaparadigm.com>2007-10-25 02:26:00 +0000
commitdfaf67043658eef1d76df9d3f71b4952302ee936 (patch)
tree50f32cf5a45eb0b833236268b438fd4fd8d9720b /debug.h
parentecf2c9b74b0b6801e988629715cdcf113d389fad (diff)
* Add macros to enable compiling out debug code
Geoffrey Young, geoff at modperlcookbook dot org git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@18 327403b1-1117-474d-bef2-5cb71233fd97
Diffstat (limited to 'debug.h')
-rw-r--r--debug.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/debug.h b/debug.h
index 1db69ef..8c183e1 100644
--- a/debug.h
+++ b/debug.h
@@ -21,4 +21,22 @@ extern void mc_debug(const char *msg, ...);
extern void mc_error(const char *msg, ...);
extern void mc_info(const char *msg, ...);
+#ifdef MC_MAINTAINER_MODE
+#define MC_SET_DEBUG(x) mc_set_debug(x)
+#define MC_GET_DEBUG() mc_get_debug()
+#define MC_SET_SYSLOG(x) mc_set_syslog(x)
+#define MC_ABORT(x, ...) mc_abort(x, ##__VA_ARGS__)
+#define MC_DEBUG(x, ...) mc_debug(x, ##__VA_ARGS__)
+#define MC_ERROR(x, ...) mc_error(x, ##__VA_ARGS__)
+#define MC_INFO(x, ...) mc_info(x, ##__VA_ARGS__)
+#else
+#define MC_SET_DEBUG(x) if (0) mc_set_debug(x)
+#define MC_GET_DEBUG() (0)
+#define MC_SET_SYSLOG(x) if (0) mc_set_syslog(x)
+#define MC_ABORT(x, ...) if (0) mc_abort(x, ##__VA_ARGS__)
+#define MC_DEBUG(x, ...) if (0) mc_debug(x, ##__VA_ARGS__)
+#define MC_ERROR(x, ...) if (0) mc_error(x, ##__VA_ARGS__)
+#define MC_INFO(x, ...) if (0) mc_info(x, ##__VA_ARGS__)
+#endif
+
#endif