diff options
author | Brendan Kehoe <brendan@gcc.gnu.org> | 1996-12-11 18:58:22 -0500 |
---|---|---|
committer | Brendan Kehoe <brendan@gcc.gnu.org> | 1996-12-11 18:58:22 -0500 |
commit | 664041e68bccafd2a1983f8416b43f95843ec4d3 (patch) | |
tree | 0444499903b8c6465c0e9bafd488e95e1e58abbb | |
parent | 09f532c97be76ce24c15d76ea1d964cae24fcfd7 (diff) | |
download | gcc-664041e68bccafd2a1983f8416b43f95843ec4d3.zip gcc-664041e68bccafd2a1983f8416b43f95843ec4d3.tar.gz gcc-664041e68bccafd2a1983f8416b43f95843ec4d3.tar.bz2 |
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
-rw-r--r-- | gcc/collect2.c | 2 |
1 files changed, 2 insertions, 0 deletions
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 |