A little cpp magic to cause compilation to fail if valgrind.h is included
directly into sources (it should not be, and was causing people problems).
MERGE TO STABLE
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1456 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/helgrind/helgrind.h b/helgrind/helgrind.h
index 2b25d47..b2f61d4 100644
--- a/helgrind/helgrind.h
+++ b/helgrind/helgrind.h
@@ -57,6 +57,7 @@
#ifndef __HELGRIND_H
#define __HELGRIND_H
+#define __VALGRIND_SOMESKIN_H
#include "valgrind.h"
typedef
diff --git a/include/valgrind.h b/include/valgrind.h
index dad18ee..e236245 100644
--- a/include/valgrind.h
+++ b/include/valgrind.h
@@ -60,6 +60,17 @@
#define __VALGRIND_H
+#ifndef __VALGRIND_SOMESKIN_H
+#warning For valgrind versions 1.9.0 and after,
+#warning you should not include valgrind.h directly.
+#warning Instead include the .h relevant to the skin
+#warning you want to use. For most people this means
+#warning you need to include memcheck.h instead of
+#warning valgrind.h.
+#error Compilation of your source will now abort.
+#endif
+
+
/* This file is for inclusion into client (your!) code.
You can use these macros to manipulate and query Valgrind's
diff --git a/memcheck/memcheck.h b/memcheck/memcheck.h
index 0dc5448..151797a 100644
--- a/memcheck/memcheck.h
+++ b/memcheck/memcheck.h
@@ -68,6 +68,7 @@
See comment near the top of valgrind.h on how to use them.
*/
+#define __VALGRIND_SOMESKIN_H
#include "valgrind.h"
typedef