Sync from upstream.

This commit is contained in:
Rene Rivera
2024-07-18 09:27:39 -05:00
2 changed files with 36 additions and 0 deletions

View File

@@ -27,6 +27,15 @@ target_link_libraries(boost_interprocess
Boost::winapi
)
if(CMAKE_VERSION VERSION_GREATER 3.18 AND CMAKE_GENERATOR MATCHES "Visual Studio")
file(GLOB_RECURSE boost_interprocess_IDEFILES CONFIGURE_DEPENDS include/*.hpp)
source_group(TREE ${PROJECT_SOURCE_DIR}/include FILES ${boost_interprocess_IDEFILES} PREFIX "Header Files")
list(APPEND boost_interprocess_IDEFILES extra/boost_interprocess.natvis)
target_sources(boost_interprocess PRIVATE ${boost_interprocess_IDEFILES})
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(boost_interprocess INTERFACE rt)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Braden Ganetsky.
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="boost::interprocess::offset_ptr&lt;*&gt;" Inheritable="false">
<!-- This is a simplified and inlined version of `offset_ptr::get()` -->
<Intrinsic Name="get" Expression="(internal.m_offset == 1) ? (pointer)nullptr : (pointer)((unsigned char*)this + internal.m_offset)" />
<Intrinsic Name="boost_to_address" ReturnType="pointer" Expression="get()" />
<!-- This is a simplified and inlined version of `offset_ptr::operator+=()` -->
<Intrinsic Name="boost_next" ReturnType="pointer" Expression="reinterpret_cast&lt;pointer&gt;( reinterpret_cast&lt;unsigned char*&gt;(ptr) + static_cast&lt;offset_type&gt;(offset * (difference_type)sizeof(element_type)) )">
<Parameter Name="ptr" Type="pointer" />
<Parameter Name="offset" Type="difference_type" />
</Intrinsic>
<DisplayString>{get()}</DisplayString>
<Expand>
<ExpandedItem>get()</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>