Mercurial > hg > CbC > CbC_gcc
diff gcc/gcc-plugin.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
line wrap: on
line diff
--- a/gcc/gcc-plugin.h Tue May 25 18:58:51 2010 +0900 +++ b/gcc/gcc-plugin.h Tue Mar 22 17:18:12 2011 +0900 @@ -26,6 +26,7 @@ #include "config.h" #include "system.h" +#include "coretypes.h" #include "highlev-plugin-common.h" #include "hashtab.h" @@ -38,6 +39,12 @@ PLUGIN_EVENT_FIRST_DYNAMIC }; +/* All globals declared here have C linkage to reduce link compatibility + issues with implementation language choice and mangling. */ +#ifdef __cplusplus +extern "C" { +#endif + extern const char **plugin_event_name; struct plugin_argument @@ -96,16 +103,10 @@ typedef int (*plugin_init_func) (struct plugin_name_args *plugin_info, struct plugin_gcc_version *version); -#ifdef __cplusplus -extern "C" { -#endif /* Declaration for "plugin_init" function so that it doesn't need to be duplicated in every plugin. */ extern int plugin_init (struct plugin_name_args *plugin_info, struct plugin_gcc_version *version); -#ifdef __cplusplus -} -#endif /* Function type for a plugin callback routine. @@ -147,4 +148,19 @@ -iplugindir program argument to cc1. */ extern const char* default_plugin_dir_name (void); +#ifdef __cplusplus +} +#endif + +/* In case the C++ compiler does name mangling for globals, declare + plugin_is_GPL_compatible extern "C" so that a later definition + in a plugin file will have this linkage. */ +#ifdef __cplusplus +extern "C" { +#endif +extern int plugin_is_GPL_compatible; +#ifdef __cplusplus +} +#endif + #endif /* GCC_PLUGIN_H */