aboutsummaryrefslogtreecommitdiff
path: root/gcc/fix-header.c
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1994-08-11 13:36:33 -0700
committerPer Bothner <bothner@gcc.gnu.org>1994-08-11 13:36:33 -0700
commitb4e21e27a37c1e9b0821016fab019fcd08c8a840 (patch)
tree98e41f69671c4b84a60c3d434858f6160f0d61fa /gcc/fix-header.c
parenta3f2d1bab1ad1dff1be1ca6a08329b4abd4581ee (diff)
downloadgcc-b4e21e27a37c1e9b0821016fab019fcd08c8a840.zip
gcc-b4e21e27a37c1e9b0821016fab019fcd08c8a840.tar.gz
gcc-b4e21e27a37c1e9b0821016fab019fcd08c8a840.tar.bz2
If NO_IMPLICIT_EXTERN_C is defined, add extern "C" { ... }.
From-SVN: r7894
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r--gcc/fix-header.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 421992a..eba15fa 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -381,8 +381,13 @@ write_rbrac ()
char **rptr;
if (required_unseen_count)
- fprintf (outf,
- "#if defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__)\n");
+ {
+ fprintf (outf,
+ "#if defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__)\n");
+#ifdef NO_IMPLICIT_EXTERN_C
+ fprintf (outf, "extern \"C\" {\n");
+#endif
+ }
/* Now we print out prototypes for those functions that we haven't seen. */
for (rptr = required_functions; *rptr; rptr++)
@@ -410,8 +415,13 @@ write_rbrac ()
fprintf (outf, "#endif\n");
}
if (required_unseen_count)
- fprintf (outf,
- "#endif /* defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__*/\n");
+ {
+#ifdef NO_IMPLICIT_EXTERN_C
+ fprintf (outf, "}\n");
+#endif
+ fprintf (outf,
+ "#endif /* defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__*/\n");
+ }
switch (special_file_handling)
{