summaryrefslogtreecommitdiff
path: root/dbus/dbus-valgrind-internal.h
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-02-13 17:53:51 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-02-13 17:54:21 +0000
commitb3f2ee5c6bade555630e52b8aa18fd639e047a80 (patch)
tree24b4633a490c07bb55eb6052d68bcb4355fa5b9d /dbus/dbus-valgrind-internal.h
parent05cc2c3348e406027837e60a2c1015b997760c83 (diff)
downloaddbus-b3f2ee5c6bade555630e52b8aa18fd639e047a80.tar.gz
Add support for inserting (a subset of) Valgrind client requests
If valgrind support is disabled, we define stub versions of the Valgrind client requests I plan to use, so the actual code doesn't need #ifdef hell. [With unnecessary AC_SUBST removed as per Lennart's review -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37286 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
Diffstat (limited to 'dbus/dbus-valgrind-internal.h')
-rw-r--r--dbus/dbus-valgrind-internal.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/dbus/dbus-valgrind-internal.h b/dbus/dbus-valgrind-internal.h
new file mode 100644
index 00000000..4c972c59
--- /dev/null
+++ b/dbus/dbus-valgrind-internal.h
@@ -0,0 +1,47 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/* dbus-valgrind-internal.h - valgrind glue
+ *
+ * Copyright © 2011 Nokia Corporation
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef DBUS_VALGRIND_INTERNAL_H
+#define DBUS_VALGRIND_INTERNAL_H
+
+#include "config.h"
+#include "dbus-internals.h"
+
+#ifdef WITH_VALGRIND
+# include <memcheck.h>
+# include <valgrind.h>
+#else
+# define VALGRIND_CREATE_MEMPOOL(_1, _2, _3) /* nothing */
+# define VALGRIND_DESTROY_MEMPOOL(_1) /* nothing */
+# define VALGRIND_MEMPOOL_ALLOC(_1, _2, _3) /* nothing */
+# define VALGRIND_MEMPOOL_FREE(_1, _2) /* nothing */
+# define VALGRIND_MAKE_MEM_UNDEFINED(_1, _2) (0)
+
+# define VALGRIND_PRINTF(...) (0)
+# define VALGRIND_PRINTF_BACKTRACE(...) (0)
+
+# define RUNNING_ON_VALGRIND 0
+#endif /* WITH_VALGRIND */
+
+#endif /* header guard */