浏览代码

gcc: Enclose the whole thing in `extern "C"'.

* gcc-plugin/src/starpu.c [__cplusplus]: Enclose everything in `extern "C"'.
Ludovic Courtès 13 年之前
父节点
当前提交
384b221ec8
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      gcc-plugin/src/starpu.c

+ 11 - 2
gcc-plugin/src/starpu.c

@@ -19,8 +19,6 @@
 
 #include <starpu-gcc-config.h>
 
-int plugin_is_GPL_compatible;
-
 /* #define ENABLE_TREE_CHECKING 1 */
 
 #include <gcc-plugin.h>
@@ -62,6 +60,13 @@ int plugin_is_GPL_compatible;
 #include <starpu.h>  /* for `STARPU_CPU' & co.  */
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Declared with `C' linkage in <gcc-plugin.h>.  */
+int plugin_is_GPL_compatible;
+
 /* The name of this plug-in.  */
 static const char plugin_name[] = "starpu";
 
@@ -2459,3 +2464,7 @@ plugin_init (struct plugin_name_args *plugin_info,
 
   return 0;
 }
+
+#ifdef __cplusplus
+}
+#endif