This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH COMMITTED: Make filenames.h C++ safe
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 21 Mar 2008 16:36:22 -0700
- Subject: 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 */