diff options
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/plugins.texi | 11 |
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 |