[fastrtps] Replace xtime with _timespec64 for fixing error C2065 (#30823)

* fix xtime*

* update version

* update patch

* update version

---------

Co-authored-by: Monica <v-liumonica@microsoft.com>
This commit is contained in:
MonicaLiu 2023-04-14 12:48:43 +08:00 committed by GitHub
parent f0b5a6b60a
commit 809266d51a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ca47ae..632c38b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,18 @@ message(STATUS "Version: ${PROJECT_VERSION}")
###############################################################################
option(EPROSIMA_BUILD "Activate internal building" OFF)
+###############################################################################
+# Replace xtime with _timespec64. As a workround of the unreleased version of
+# MSVC, it will be deleted after release.
+###############################################################################
+if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.36.32528.95")
+ file(READ "${PROJECT_SOURCE_DIR}/include/fastrtps/utils/TimedMutex.hpp" _contents)
+ string(REPLACE "xtime*" "_timespec64*" _contents "${_contents}")
+ file(WRITE "${PROJECT_SOURCE_DIR}/include/fastrtps/utils/TimedMutex.hpp" "${_contents}")
+ endif()
+endif()
+
###############################################################################
# Warning level
###############################################################################

View File

@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
fix-find-package-asio.patch
disable-symlink.patch
fix-xtime.patch
)
vcpkg_cmake_configure(
@ -69,4 +70,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/tools")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,6 +1,7 @@
{
"name": "fastrtps",
"version": "2.7.0",
"port-version": 1,
"description": "Eprosima Fast RTPS is a C++ implementation of the RTPS (Real Time Publish Subscribe) protocol, which provides publisher-subscriber communications over unreliable transports such as UDP, as defined and maintained by the Object Management Group (OMG) consortium.",
"homepage": "https://www.eprosima.com/",
"license": "Apache-2.0",

View File

@ -2426,7 +2426,7 @@
},
"fastrtps": {
"baseline": "2.7.0",
"port-version": 0
"port-version": 1
},
"fawdlstty-libfv": {
"baseline": "0.0.8",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b2d64bc038a30ea7ad49dc5cb923c0e13618281c",
"version": "2.7.0",
"port-version": 1
},
{
"git-tree": "7a1b9df69d8a4219b390a65056d837dc6c0f385c",
"version": "2.7.0",