aboutsummaryrefslogtreecommitdiff
path: root/gcc/fix-header.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r--gcc/fix-header.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index eba15fa..c21acf0 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -385,7 +385,7 @@ write_rbrac ()
fprintf (outf,
"#if defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__)\n");
#ifdef NO_IMPLICIT_EXTERN_C
- fprintf (outf, "extern \"C\" {\n");
+ fprintf (outf, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
#endif
}
@@ -417,7 +417,7 @@ write_rbrac ()
if (required_unseen_count)
{
#ifdef NO_IMPLICIT_EXTERN_C
- fprintf (outf, "}\n");
+ fprintf (outf, "#ifdef __cplusplus\n}\n#endif\n");
#endif
fprintf (outf,
"#endif /* defined(__cplusplus) || defined(__USE_FIXED_PROTOTYPES__*/\n");