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
This commit is contained in:
Brendan Kehoe 1996-12-11 18:58:22 -05:00
parent 09f532c97b
commit 664041e68b

View File

@ -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