]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR plugins/44459:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Jun 2010 23:21:48 +0000 (23:21 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 8 Jun 2010 23:21:48 +0000 (23:21 +0000)
* gcc-plugin.h: Encapsulate all declarations in extern "C".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160448 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gcc-plugin.h

index 968434e1998100d84547df89e6120e8187d81f30..dc3390cc6e386b0d9d9d2a5e6ad541291be549e7 100644 (file)
@@ -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,
index 948c4397570c65a51bfda95ff97fb186aba62603..5db2c710be577aed2baae9965fcd2bb8522b946f 100644 (file)
@@ -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 */