From b4e21e27a37c1e9b0821016fab019fcd08c8a840 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Thu, 11 Aug 1994 13:36:33 -0700 Subject: [PATCH] If NO_IMPLICIT_EXTERN_C is defined, add extern "C" { ... }. From-SVN: r7894 --- gcc/fix-header.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 421992ae2976..eba15fa909a5 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) { -- 2.43.5