Skip to content

Commit

Permalink
[fastrtps] Fix the macro definition in thread (microsoft#33994)
Browse files Browse the repository at this point in the history
* 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) <[email protected]>
  • Loading branch information
jimwang118 and jimwang118 authored Oct 20, 2023
1 parent 987d232 commit 6abb43b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
40 changes: 40 additions & 0 deletions ports/fastrtps/fix_thread.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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;
1 change: 1 addition & 0 deletions ports/fastrtps/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vcpkg_from_github(
fix-find-package-asio.patch
disable-symlink.patch
fix-xtime.patch
fix_thread.patch #https://github.com/eProsima/Fast-DDS/pull/3904
)

vcpkg_cmake_configure(
Expand Down
2 changes: 1 addition & 1 deletion versions/f-/fastrtps.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "17e66e986b0296a09cf61691351f381bea310538",
"git-tree": "75ba9fed16853532cfc26487e85e4309289b8dd2",
"version": "2.7.0",
"port-version": 3
},
Expand Down

0 comments on commit 6abb43b

Please sign in to comment.