* lib/dirent.in.h (dirfd): In C++ mode with GNULIB_NAMESPACE, turn the
macro into a function.
Reported by Jarno Rajahalme <jarno.rajahalme@nsn.com>.
+2010-09-04 Bruno Haible <bruno@clisp.org>
+
+ dirfd: Fix compilation error in C++ mode on MacOS X, *BSD, IRIX.
+ * lib/dirent.in.h (dirfd): In C++ mode with GNULIB_NAMESPACE, turn the
+ macro into a function.
+ Reported by Jarno Rajahalme <jarno.rajahalme@nsn.com>.
+
2010-09-04 Bruno Haible <bruno@clisp.org>
Set PATH_SEPARATOR the same way autoconf does.
_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
# else
+# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
+ /* dirfd is defined as a macro and not as a function.
+ Turn it into a function and get rid of the macro. */
+static inline int (dirfd) (DIR *dp) { return dirfd (dp); }
+# undef dirfd
+# endif
# if !(@HAVE_DECL_DIRFD@ || defined dirfd)
_GL_FUNCDECL_SYS (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
# endif