[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
make dirname work with C++
From: |
Werner LEMBERG |
Subject: |
make dirname work with C++ |
Date: |
Sun, 21 Sep 2014 17:10:15 +0200 (CEST) |
Here's a necessary patch for making `dirname' work with C++.
Werner
======================================================================
diff --git a/ChangeLog b/ChangeLog
index 58a6511..9ac551d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-21 Werner Lemberg <address@hidden>
+
+ dirname: support compilation with C++
+ * lib/dirname.h: Add necessary C linkage declarations.
+
2014-09-16 Paul Eggert <address@hidden>
qsort_r: include <config.h>
diff --git a/lib/dirname.h b/lib/dirname.h
index a1b7009..657d265 100644
--- a/lib/dirname.h
+++ b/lib/dirname.h
@@ -31,6 +31,10 @@
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
# endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
# if GNULIB_DIRNAME
char *base_name (char const *file);
char *dir_name (char const *file);
@@ -43,4 +47,8 @@ char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
bool strip_trailing_slashes (char *file);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif /* not DIRNAME_H_ */
- make dirname work with C++,
Werner LEMBERG <=