@@ -9,12 +9,18 @@
#include "go-system.h"
#include "sha1.h"
+#ifndef ENABLE_BUILD_WITH_CXX
extern "C"
{
+#endif
+
#include "machmode.h"
#include "output.h"
#include "target.h"
+
+#ifndef ENABLE_BUILD_WITH_CXX
}
+#endif
#include "gogo.h"
#include "types.h"
@@ -8,8 +8,11 @@
#include <gmp.h>
+#ifndef ENABLE_BUILD_WITH_CXX
extern "C"
{
+#endif
+
#include "toplev.h"
#include "intl.h"
#include "tree.h"
@@ -19,7 +22,10 @@
#include "real.h"
#include "realmpfr.h"
#include "tm_p.h"
-}
+
+#ifndef ENABLE_BUILD_WITH_CXX
+}
+#endif
#include "go-c.h"
#include "gogo.h"
@@ -47,7 +47,7 @@
// Enable a dump. Return 1 if this is a real name, 0 if not.
-extern "C"
+GO_EXTERN_C
int
go_enable_dump(const char* name)
{
@@ -26,7 +26,7 @@
// Create the main IR data structure.
-extern "C"
+GO_EXTERN_C
void
go_create_gogo()
{
@@ -38,7 +38,7 @@
// Set the unique prefix we use for exported symbols.
-extern "C"
+GO_EXTERN_C
void
go_set_prefix(const char* arg)
{
@@ -58,7 +58,7 @@
// Parse the input files.
-extern "C"
+GO_EXTERN_C
void
go_parse_input_files(const char** filenames, unsigned int filename_count)
{
@@ -139,7 +139,7 @@
// Write out globals.
-extern "C"
+GO_EXTERN_C
void
go_write_globals()
{
@@ -11,8 +11,11 @@
#include <gmp.h>
+#ifndef ENABLE_BUILD_WITH_CXX
extern "C"
{
+#endif
+
#include "toplev.h"
#include "tree.h"
#include "gimple.h"
@@ -24,7 +27,10 @@
#include "tm_p.h"
#include "diagnostic.h"
#include "rtl.h"
+
+#ifndef ENABLE_BUILD_WITH_CXX
}
+#endif
#include "go-c.h"
#include "types.h"
@@ -1963,7 +1969,7 @@
// Return the integer type to use for a size.
-extern "C"
+GO_EXTERN_C
tree
go_type_for_size(unsigned int bits, int unsignedp)
{
@@ -1994,7 +2000,7 @@
// Return the type to use for a mode.
-extern "C"
+GO_EXTERN_C
tree
go_type_for_mode(enum machine_mode mode, int unsignedp)
{
@@ -10,10 +10,16 @@
#include <cstring>
#include <unistd.h>
+#ifndef ENABLE_BUILD_WITH_CXX
extern "C"
{
+#endif
+
#include "filenames.h"
+
+#ifndef ENABLE_BUILD_WITH_CXX
}
+#endif
#include "simple-object.h"
@@ -30,7 +36,7 @@
// Add a directory to the search path. This is called from the option
// handling language hook.
-extern "C"
+GO_EXTERN_C
void
go_add_search_path(const char* path)
{
@@ -9,8 +9,11 @@
#include <tr1/unordered_set>
#include <gmp.h>
+#ifndef ENABLE_BUILD_WITH_CXX
extern "C"
{
+#endif
+
#include "intl.h"
#include "tree.h"
#include "gimple.h"
@@ -18,7 +21,10 @@
#include "tree-iterator.h"
#include "tree-flow.h"
#include "real.h"
+
+#ifndef ENABLE_BUILD_WITH_CXX
}
+#endif
#include "go-c.h"
#include "types.h"
@@ -10,15 +10,21 @@
#include <gmp.h>
+#ifndef ENABLE_BUILD_WITH_CXX
extern "C"
{
+#endif
+
#include "toplev.h"
#include "intl.h"
#include "tree.h"
#include "gimple.h"
#include "real.h"
#include "convert.h"
-}
+
+#ifndef ENABLE_BUILD_WITH_CXX
+}
+#endif
#include "go-c.h"
#include "gogo.h"