From ae6c180be84b59dd8b192f8b7f55668353427e01 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 9 Apr 2007 16:37:30 +0000 Subject: [PATCH] _MANAGED fix for sp_enable_shared_from_this [SVN r37403] --- include/boost/shared_ptr.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index 639066e..69bff58 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -88,6 +88,21 @@ template void sp_enable_shared_from_this( shared_count const & if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast(px), pn); } +#ifdef _MANAGED + +// Avoid C4793, ... causes native code generation + +struct sp_any_pointer +{ + template sp_any_pointer( T* ) {} +}; + +inline void sp_enable_shared_from_this( shared_count const & /*pn*/, sp_any_pointer, sp_any_pointer ) +{ +} + +#else // _MANAGED + #ifdef sgi // Turn off: the last argument of the varargs function "sp_enable_shared_from_this" is unnamed # pragma set woff 3506 @@ -101,6 +116,8 @@ inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... ) # pragma reset woff 3506 #endif +#endif // _MANAGED + #if !defined( BOOST_NO_SFINAE ) && !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( BOOST_NO_AUTO_PTR ) // rvalue auto_ptr support based on a technique by Dave Abrahams