From: Julian Seward Date: Sat, 15 Mar 2003 19:12:43 +0000 (+0000) Subject: A little cpp magic to cause compilation to fail if valgrind.h is included X-Git-Tag: svn/VALGRIND_2_0_0~272 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c53966da7ccb9700f055e9ad431dd9b7d2ac3a2c;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/helgrind/helgrind.h b/helgrind/helgrind.h index 2b25d47f49..b2f61d40a2 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 dad18ee650..e236245d45 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 0dc5448ffd..151797a9f5 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