forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fastrtps] Fix the macro definition in thread (microsoft#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) <[email protected]>
- Loading branch information
1 parent
987d232
commit 6abb43b
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters