From e297475f0d05b3c8cfbc5cee90add7d7a37c6a02 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 2 Jun 2021 18:07:46 +0200 Subject: Cleanup: add proj/internal/mutex.hpp as compat layer for mingw32 for std::mutex --- src/networkfilemanager.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'src/networkfilemanager.cpp') diff --git a/src/networkfilemanager.cpp b/src/networkfilemanager.cpp index fa6375b8..d331f4d6 100644 --- a/src/networkfilemanager.cpp +++ b/src/networkfilemanager.cpp @@ -40,25 +40,10 @@ #include "proj.h" #include "proj/internal/internal.hpp" #include "proj/internal/lru_cache.hpp" +#include "proj/internal/mutex.hpp" #include "proj_internal.h" #include "sqlite3_utils.hpp" -#ifdef __MINGW32__ -// mingw32-win32 doesn't implement std::mutex -namespace { -class MyMutex { - public: - // cppcheck-suppress functionStatic - void lock() { pj_acquire_lock(); } - // cppcheck-suppress functionStatic - void unlock() { pj_release_lock(); } -}; -} // namespace -#else -#include -#define MyMutex std::mutex -#endif - #ifdef CURL_ENABLED #include #include // for sqlite3_snprintf @@ -152,7 +137,7 @@ class NetworkChunkCache { }; lru11::Cache< - Key, std::shared_ptr>, MyMutex, + Key, std::shared_ptr>, NS_PROJ::mutex, std::unordered_map< Key, typename std::list cache_{}; + lru11::Cache cache_{}; }; // --------------------------------------------------------------------------- -- cgit v1.2.3