From 664041e68bccafd2a1983f8416b43f95843ec4d3 Mon Sep 17 00:00:00 2001 From: Brendan Kehoe Date: Wed, 11 Dec 1996 18:58:22 -0500 Subject: collect2.c (write_c_file): Wrap the ctor/dtor lists and fns with `extern "C" { ... * collect2.c (write_c_file): Wrap the ctor/dtor lists and fns with `extern "C" { ... }', to avoid having the fn names mangled with the C++ driver. From-SVN: r13288 --- gcc/collect2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc') diff --git a/gcc/collect2.c b/gcc/collect2.c index 452ac99..341c70e 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1789,12 +1789,14 @@ write_c_file (stream, name) FILE *stream; char *name; { + fprintf (stream, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"); #ifndef LD_INIT_SWITCH if (! shared_obj) write_c_file_glob (stream, name); else #endif write_c_file_stat (stream, name); + fprintf (stream, "#ifdef __cplusplus\n}\n#endif\n"); } static void -- cgit v1.1