This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]