Subject: [Boost-bugs] [Boost C++ Libraries] #4811: [string_algo][patch] is_any_of fails to find ::memcpy in c++builder
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-03 17:26:30
#4811: [string_algo][patch] is_any_of fails to find ::memcpy in c++builder
---------------------------------------------------+------------------------
Reporter: peter.myerscough-jackopson@⦠| Owner: pavol_droba
Type: Bugs | Status: new
Milestone: To Be Determined | Component: string_algo
Version: Boost 1.44.0 | Severity: Problem
Keywords: string_algo bug patch c++builder |
---------------------------------------------------+------------------------
C++builder has a bug in its string.h and cstring headers such that if they
are included in the 'wrong' order memcpy is no longer accessible in the
global namespace, but is accessible in the std:: namespace. see this[http
://mail-
archives.apache.org/mod_mbox/xerces-c-users/200810.mbox/%3C48E5CA01.8050204_at_[hidden]%3E]
Given that memcpy is included from cstring then std::memcpy is available
and so this simple patch enables this to work in C++Builder.
change
{{{
128 // Use fixed storage
129 ::memcpy(DestStorage, SrcStorage,
sizeof(set_value_type)*m_Size);
130 }
}}}
to
{{{
128 // Use fixed storage
129 ::std::memcpy(DestStorage, SrcStorage,
sizeof(set_value_type)*m_Size);
130 }
}}}
AND
this
{{{
208 // Copy the data
209 ::memcpy(DestStorage, SrcStorage,
sizeof(set_value_type)*m_Size);
210
211 return *this;
}}}
to this
{{{
208 // Copy the data
209 ::std::memcpy(DestStorage, SrcStorage,
sizeof(set_value_type)*m_Size);
210
211 return *this;
}}}
This will enable the is_any_of to work again for C++Builder's broken
headers. It will also improve the style of the header as all other calls
to standard functions are called in the ''std'' namespace.
Thanks
Peter Myerscough-Jackopson
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4811> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC