From 82de5b3a67a961a52e6f5a6e58d9e8ec8264b7eb Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 10 Aug 2023 22:43:46 +0200 Subject: [PATCH] Fix GNU/Hurd build It has the usual Unix filesystem operations. --- .../core/include/opencv2/core/utils/filesystem.private.hpp | 3 ++- modules/core/src/utils/filesystem.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/core/include/opencv2/core/utils/filesystem.private.hpp b/modules/core/include/opencv2/core/utils/filesystem.private.hpp index c32be15c61..70df64f0d4 100644 --- a/modules/core/include/opencv2/core/utils/filesystem.private.hpp +++ b/modules/core/include/opencv2/core/utils/filesystem.private.hpp @@ -12,7 +12,8 @@ # elif defined WINRT || defined _WIN32_WCE /* not supported */ # elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \ - defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__ + defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__ || \ + defined __GNU__ # define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 # elif defined(__APPLE__) # include diff --git a/modules/core/src/utils/filesystem.cpp b/modules/core/src/utils/filesystem.cpp index 415323490d..24f69ccb59 100644 --- a/modules/core/src/utils/filesystem.cpp +++ b/modules/core/src/utils/filesystem.cpp @@ -34,7 +34,7 @@ #include #include #include -#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ #include #include #include @@ -343,7 +343,7 @@ private: Impl& operator=(const Impl&); // disabled }; -#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ +#elif defined __linux__ || defined __APPLE__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ struct FileLock::Impl { @@ -457,7 +457,7 @@ cv::String getCacheDirectory(const char* sub_directory_name, const char* configu default_cache_path = "/tmp/"; CV_LOG_WARNING(NULL, "Using world accessible cache directory. This may be not secure: " << default_cache_path); } -#elif defined __linux__ || defined __HAIKU__ || defined __FreeBSD__ +#elif defined __linux__ || defined __HAIKU__ || defined __FreeBSD__ || defined __GNU__ // https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html if (default_cache_path.empty()) {