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 <w...@gnu.org> + + dirname: support compilation with C++ + * lib/dirname.h: Add necessary C linkage declarations. + 2014-09-16 Paul Eggert <egg...@cs.ucla.edu> 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_ */