summaryrefslogtreecommitdiff
path: root/json-c/src/debug.h
diff options
context:
space:
mode:
authorMichał Cichoń <michcic@gmail.com>2012-05-01 16:05:17 +0200
committerMichał Cichoń <michcic@gmail.com>2012-05-01 16:05:17 +0200
commit30b6a77f86a35dab16b3bf9b815e089657fc6890 (patch)
treee428795ca6f70e5eae78e236ec7feb0a986abf8b /json-c/src/debug.h
parentc8da87b5718f4637beedbab5ab2ebf24fa1b2039 (diff)
downloadpianobar-windows-build-30b6a77f86a35dab16b3bf9b815e089657fc6890.tar.gz
pianobar-windows-build-30b6a77f86a35dab16b3bf9b815e089657fc6890.tar.bz2
pianobar-windows-build-30b6a77f86a35dab16b3bf9b815e089657fc6890.zip
Update build environment to comply with latest pianobar requirements.
Replace gcrypt with blowfist library - this will allow us to keep pianobar.exe portable.
Diffstat (limited to 'json-c/src/debug.h')
-rw-r--r--json-c/src/debug.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/json-c/src/debug.h b/json-c/src/debug.h
new file mode 100644
index 0000000..1e09701
--- /dev/null
+++ b/json-c/src/debug.h
@@ -0,0 +1,72 @@
+/*
+ * $Id: debug.h,v 1.5 2006/01/30 23:07:57 mclark Exp $
+ *
+ * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
+ * Michael Clark <michael@metaparadigm.com>
+ * Copyright (c) 2009 Hewlett-Packard Development Company, L.P.
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See COPYING for details.
+ *
+ */
+
+#ifndef _DEBUG_H_
+#define _DEBUG_H_
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void mc_set_debug(int debug);
+extern int mc_get_debug(void);
+
+extern void mc_set_syslog(int syslog);
+extern void mc_abort(const char *msg, ...);
+extern void mc_debug(const char *msg, ...);
+extern void mc_error(const char *msg, ...);
+extern void mc_info(const char *msg, ...);
+
+#ifndef __STRING
+#define __STRING(x) #x
+#endif
+
+#ifndef PARSER_BROKEN_FIXED
+
+#define JASSERT(cond) do {} while(0)
+
+#else
+
+#define JASSERT(cond) do { \
+ if (!(cond)) { \
+ mc_error("cjson assert failure %s:%d : cond \"" __STRING(cond) "failed\n", __FILE__, __LINE__); \
+ *(int *)0 = 1;\
+ abort(); \
+ }\
+ } while(0)
+
+#endif
+
+#define MC_ABORT(x, ...) mc_abort(x, ##__VA_ARGS__)
+#define MC_ERROR(x, ...) mc_error(x, ##__VA_ARGS__)
+
+#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_DEBUG(x, ...) mc_debug(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_DEBUG(x, ...) if (0) mc_debug(x, ##__VA_ARGS__)
+#define MC_INFO(x, ...) if (0) mc_info(x, ##__VA_ARGS__)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif