X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Fgcc-plugin.h;h=543dc933742c35b2c72bc24f0b3db21e1c30023f;hp=6865566472f20edbc888ac39af4de670ff41b60b;hb=c80cefd7b6f98689eaf677f6124146225001001a;hpb=090a8c65a39d28dcd3e067f084b62c632f128a34 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.