aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorBasile Starynkevitch <basile@starynkevitch.net>2011-07-06 16:37:09 +0000
committerBasile Starynkevitch <bstarynk@gcc.gnu.org>2011-07-06 16:37:09 +0000
commitbf5884559be4e9bfd8216516d540414dfede1d26 (patch)
tree38ed9939c26dba6d87fde9593de9440bc6b331cc /gcc/doc
parentc8ecdaba8771fa7acbff71d1a857dd5fee898601 (diff)
downloadgcc-bf5884559be4e9bfd8216516d540414dfede1d26.zip
gcc-bf5884559be4e9bfd8216516d540414dfede1d26.tar.gz
gcc-bf5884559be4e9bfd8216516d540414dfede1d26.tar.bz2
configure.ac (plugin-version.h): Generate GCCPLUGIN_VERSION_MAJOR...
2011-07-06 Basile Starynkevitch <basile@starynkevitch.net> * configure.ac (plugin-version.h): Generate GCCPLUGIN_VERSION_MAJOR, GCCPLUGIN_VERSION_MINOR, GCCPLUGIN_VERSION_PATCHLEVEL, GCCPLUGIN_VERSION constant integer macros. * configure: Regenerate. * doc/plugins.texi (Building GCC plugins): Mention GCCPLUGIN_VERSION ... constant macros in plugin-version.h. From-SVN: r175923
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/plugins.texi11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index 2ab2b62..1ff1447 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -417,6 +417,17 @@ invoking @command{gcc -print-file-name=plugin} (replace if needed
Inside plugins, this @code{plugin} directory name can be queried by
calling @code{default_plugin_dir_name ()}.
+Plugins may know, when they are compiled, the GCC version for which
+@file{plugin-version.h} is provided. The constant macros
+@code{GCCPLUGIN_VERSION_MAJOR}, @code{GCCPLUGIN_VERSION_MINOR},
+@code{GCCPLUGIN_VERSION_PATCHLEVEL}, @code{GCCPLUGIN_VERSION} are
+integer numbers, so a plugin could ensure it is built for GCC 4.7 with
+@smallexample
+#if GCCPLUGIN_VERSION != 4007
+#error this GCC plugin is for GCC 4.7
+#endif
+@end smallexample
+
The following GNU Makefile excerpt shows how to build a simple plugin:
@smallexample