diff options
author | Rafael Avila de Espindola <espindola@google.com> | 2009-04-17 16:03:48 +0000 |
---|---|---|
committer | Rafael Espindola <espindola@gcc.gnu.org> | 2009-04-17 16:03:48 +0000 |
commit | cf8aba7f5a071a5cb7dad4c91dd77b602861797e (patch) | |
tree | 8816dc843909a798c6868ae53bf87d630cf35e28 /gcc/gcc-plugin.h | |
parent | 61e20b90d9ae993af2c3c2f34198432eeafbfb65 (diff) | |
download | gcc-cf8aba7f5a071a5cb7dad4c91dd77b602861797e.zip gcc-cf8aba7f5a071a5cb7dad4c91dd77b602861797e.tar.gz gcc-cf8aba7f5a071a5cb7dad4c91dd77b602861797e.tar.bz2 |
Makefile.in (REVISION_s): Always include quotes.
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.
From-SVN: r146274
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 6865566..543dc93 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. |