diff options
author | espindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 16:03:48 +0000 |
---|---|---|
committer | espindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 16:03:48 +0000 |
commit | c80cefd7b6f98689eaf677f6124146225001001a (patch) | |
tree | 8816dc843909a798c6868ae53bf87d630cf35e28 /gcc/gcc-plugin.h | |
parent | 090a8c65a39d28dcd3e067f084b62c632f128a34 (diff) | |
download | gcc-c80cefd7b6f98689eaf677f6124146225001001a.tar.gz |
2009-04-17 Rafael Avila de Espindola <espindola@google.com>
* Makefile.in (REVISION_s): Always include quotes. Change ifdef to use
REVISION_c.
(OBJS-common): Add plugin-version.o.
(plugin-version.o): New.
* gcc-plugin.h (plugin_gcc_version): New.
(plugin_default_version_check): New.
(plugin_init_func, plugin_init): Add version argument.
* plugin-version.c: New.
* plugin.c (str_plugin_gcc_version_name): New.
(try_init_one_plugin): Read plugin_gcc_version from the plugin and
pass it to the init function.
(plugin_default_version_check): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146274 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc-plugin.h')
-rw-r--r-- | gcc/gcc-plugin.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h index 6865566472f..543dc933742 100644 --- a/gcc/gcc-plugin.h +++ b/gcc/gcc-plugin.h @@ -67,22 +67,42 @@ struct plugin_info const char *help; }; +/* Represents the gcc version. Used to avoid using an incompatible plugin. */ + +struct plugin_gcc_version +{ + const char *basever; + const char *datestamp; + const char *devphase; + const char *revision; + const char *configuration_arguments; +}; + +extern struct plugin_gcc_version plugin_gcc_version; + +/* The default version check. Compares every field in VERSION. */ + +extern bool plugin_default_version_check(struct plugin_gcc_version *version); + /* Function type for the plugin initialization routine. Each plugin module should define this as an externally-visible function with name "plugin_init." PLUGIN_NAME - name of the plugin (useful for error reporting) + VERSION - the plugin_gcc_version symbol of the plugin itself. ARGC - the size of the ARGV array ARGV - an array of key-value argument pair Returns 0 if initialization finishes successfully. */ typedef int (*plugin_init_func) (const char *plugin_name, + struct plugin_gcc_version *version, int argc, struct plugin_argument *argv); /* Declaration for "plugin_init" function so that it doesn't need to be duplicated in every plugin. */ -extern int plugin_init (const char *, int, struct plugin_argument *); +extern int plugin_init (const char *, struct plugin_gcc_version *version, + int, struct plugin_argument *); /* Function type for a plugin callback routine. |