aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2010-06-08 23:21:48 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2010-06-09 00:21:48 +0100
commitf1c3bf869c225208f9b987dec37de6f4ff256ba2 (patch)
tree53563bfbf7c52a6fc946b48beaaeba263816d628
parent6903fcbd9be6a24fd31f36c960d720c3106a0a40 (diff)
downloadgcc-f1c3bf869c225208f9b987dec37de6f4ff256ba2.zip
gcc-f1c3bf869c225208f9b987dec37de6f4ff256ba2.tar.gz
gcc-f1c3bf869c225208f9b987dec37de6f4ff256ba2.tar.bz2
re PR plugins/44459 (plugin interface depends on name mangling)
PR plugins/44459: * gcc-plugin.h: Encapsulate all declarations in extern "C". From-SVN: r160448
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/gcc-plugin.h16
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 968434e..dc3390c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR plugins/44459:
+ * gcc-plugin.h: Encapsulate all declarations in extern "C".
+
2010-06-08 Jan Hubicka <jh@suse.cz>
* basic-block.h (single_succ_edge, single_pred_edge, ei_container,
diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h
index 948c439..5db2c71 100644
--- a/gcc/gcc-plugin.h
+++ b/gcc/gcc-plugin.h
@@ -38,6 +38,12 @@ enum plugin_event
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 +102,10 @@ extern bool plugin_default_version_check (struct plugin_gcc_version *,
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 +147,8 @@ extern int unregister_callback (const char *plugin_name, int event);
-iplugindir program argument to cc1. */
extern const char* default_plugin_dir_name (void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GCC_PLUGIN_H */