vcpkg/ports/fastrtps/fix_thread.patch
jim wang 6abb43bde5
[fastrtps] Fix the macro definition in thread (#33994)
* fix thread

* update version

* add upstream PR URL

* update version

* fix macro

* update version

* delete comment

* update version

* fix stl

* update version

* Generate Imath.pc

* update version

* add dependency imath minizip-ng

* updata version

* Add type conversion

* update version

* update version

* fix msvc test

* update version

* fix patch

* update version

* fix patch

* update version

---------

Co-authored-by: Jim wang (BEYONDSOFT CONSULTING INC) <v-wangjim@microsoft.com>
2023-10-20 10:00:10 -07:00

41 lines
1.1 KiB
Diff

diff --git a/include/fastrtps/utils/TimedMutex.hpp b/include/fastrtps/utils/TimedMutex.hpp
index 8d5d968..7ba3e00 100644
--- a/include/fastrtps/utils/TimedMutex.hpp
+++ b/include/fastrtps/utils/TimedMutex.hpp
@@ -23,10 +23,14 @@
#include <iostream>
#if defined(_WIN32)
+#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
+#include <mutex>
+#else
#include <thread>
extern int clock_gettime(
int,
struct timespec* tv);
+#endif // if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
#elif _GTHREAD_USE_MUTEX_TIMEDLOCK
#include <mutex>
#else
@@ -37,6 +41,11 @@ namespace eprosima {
namespace fastrtps {
#if defined(_WIN32)
+
+#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
+using TimedMutex = std::timed_mutex;
+using RecursiveTimedMutex = std::recursive_timed_mutex;
+#else
class TimedMutex
{
public:
@@ -182,6 +191,8 @@ private:
_Mtx_t mutex_;
};
+#endif // if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 193632528
+
#elif _GTHREAD_USE_MUTEX_TIMEDLOCK || !defined(__unix__)
using TimedMutex = std::timed_mutex;
using RecursiveTimedMutex = std::recursive_timed_mutex;