Source: doxygen
Version: 1.9.4-3
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
Currently doxygen FTBFS on GNU/Hurd due to a PATH_MAX issue.
The attached patch, filesystem_filesystem.hpp.diff, fixes the build
problem by special-casing for Hurd. In fact the patch could be applied
to all glibc-based systems and upstreamed.
However, it is not very C++-ish, maybe some better solution could be
used. Cc-ing bug-hurd for comments, WDYT?
Thanks!
Index: doxygen-1.9.4/filesystem/filesystem.hpp
===================================================================
--- doxygen-1.9.4.orig/filesystem/filesystem.hpp
+++ doxygen-1.9.4/filesystem/filesystem.hpp
@@ -56,6 +56,8 @@
#define GHC_OS_MACOS
#elif defined(__linux__)
#define GHC_OS_LINUX
+#elif defined(__GNU__)
+#define GHC_OS_GNU
#if defined(__ANDROID__)
#define GHC_OS_ANDROID
#endif
@@ -4081,6 +4083,13 @@ GHC_INLINE path current_path(std::error_
return path();
}
return path(std::wstring(buffer.get()), path::native_format);
+#elif defined(GHC_OS_GNU)
+ char* buffer = ::getcwd (NULL, 0);
+ if (buffer == nullptr) {
+ ec = detail::make_system_error();
+ return path();
+ }
+ return path(buffer);
#else
size_t pathlen = static_cast<size_t>(std::max(int(::pathconf(".", _PC_PATH_MAX)), int(PATH_MAX)));
std::unique_ptr<char[]> buffer(new char[pathlen + 1]);