From: Julian Seward Date: Mon, 19 Apr 2010 08:43:26 +0000 (+0000) Subject: Rename preprocessor macro __VALGRIND__ to __VALGRIND_MAJOR__ and add X-Git-Tag: svn/VALGRIND_3_6_0~319 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55089819eb2e419453c2681167af9ee72879c125;p=thirdparty%2Fvalgrind.git Rename preprocessor macro __VALGRIND__ to __VALGRIND_MAJOR__ and add comments. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11105 --- diff --git a/docs/internals/release-HOWTO.txt b/docs/internals/release-HOWTO.txt index 54b98a042b..df2152232d 100644 --- a/docs/internals/release-HOWTO.txt +++ b/docs/internals/release-HOWTO.txt @@ -21,6 +21,9 @@ First of all: release date probably won't be known yet, updating it is in the list below of tasks for the official release.) +- Make sure __VALGRIND_MAJOR__ and __VALGRIND_MINOR__ are correct + for the release. (include/valgrind.h) + - Write release notes, add to NEWS. Include a list of fixed bugs from Bugzilla. It's unclear how to do this consistently. The approach taken for 3.0.0 was to go to this page in KDE's bugzilla: diff --git a/include/valgrind.h b/include/valgrind.h index 65993fbb32..43e3657a56 100644 --- a/include/valgrind.h +++ b/include/valgrind.h @@ -79,8 +79,16 @@ /* ------------------------------------------------------------------ */ /* Specify Valgrind's version number, so that user code can - conditionally compile based on our version number. */ -#define __VALGRIND__ 3 + conditionally compile based on our version number. Note that these + were introduced at version 3.6 and so do not exist in version 3.5 + or earlier. The recommended way to use them to check for "version + X.Y or later" is (eg) + +#if defined(__VALGRIND_MAJOR__) && defined(__VALGRIND_MINOR__) \ + && (__VALGRIND_MAJOR__ > 3 \ + || (__VALGRIND_MAJOR__ == 3 && __VALGRIND_MINOR__ >= 6)) +*/ +#define __VALGRIND_MAJOR__ 3 #define __VALGRIND_MINOR__ 6