OSDN Git Service

PR c++/51318
[pf3gnuchains/gcc-fork.git] / gcc / gcc-plugin.h
index ec12265..b98bcb6 100644 (file)
@@ -1,5 +1,5 @@
 /* Public header file for plugins to include.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
 #include "highlev-plugin-common.h"
 #include "hashtab.h"
 
@@ -38,6 +39,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
@@ -135,4 +142,25 @@ extern void register_callback (const char *plugin_name,
 
 extern int unregister_callback (const char *plugin_name, int event);
 
+
+/* Retrieve the plugin directory name, as returned by the
+   -fprint-file-name=plugin argument to the gcc program, which is the
+   -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 */