This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gcc-in-cxx] PATCH COMMITTED: Make progname extern "C"
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Jun 2008 05:33:53 -0700
- Subject: [gcc-in-cxx] PATCH COMMITTED: Make progname extern "C"
To avoid changing libiberty and libcpp to C++ right away, this patch
declares progname as extern "C" in toplev.h. This needs to be
conditional on compiling with C++ because some of the files linked
into the gen* programs include toplev.h, but we do not yet use C++ to
compile files which run on the build system.
Committed to gcc-in-cxx branch.
Ian
2008-06-19 Ian Lance Taylor <iant@google.com>
* toplev.h (progname): Declare as extern "C" when compiling with
C++.
Index: toplev.h
===================================================================
--- toplev.h (revision 136884)
+++ toplev.h (working copy)
@@ -107,7 +107,17 @@ extern void target_reinit (void);
/* A unique local time stamp, might be zero if none is available. */
extern unsigned local_tick;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* This is used by cpplib and libiberty. */
extern const char *progname;
+
+#ifdef __cplusplus
+}
+#endif
+
extern const char *dump_base_name;
extern const char *aux_base_name;
extern const char *aux_info_file_name;