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]

PATCH COMMITTED: Make filenames.h C++ safe


I have committed this patch to make include/filenames.h safe to use
with C++, as is true of, e.g., include/libiberty.h.

Tested by building stages 1 and 2 on i686-pc-linux-gnu.

Ian


2008-03-21  Ian Lance Taylor  <iant@google.com>

	* filenames.h: Add extern "C" when compiled with C++.


Index: filenames.h
===================================================================
--- filenames.h	(revision 133439)
+++ filenames.h	(working copy)
@@ -26,6 +26,10 @@ Foundation, Inc., 51 Franklin Street - F
 #ifndef FILENAMES_H
 #define FILENAMES_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
 
 #ifndef HAVE_DOS_BASED_FILE_SYSTEM
@@ -49,4 +53,8 @@ Foundation, Inc., 51 Franklin Street - F
 extern int filename_cmp (const char *s1, const char *s2);
 #define FILENAME_CMP(s1, s2)	filename_cmp(s1, s2)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* FILENAMES_H */


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