Opened 12 years ago

Closed 11 years ago

#4811 closed Bugs (fixed)

[string_algo][patch] is_any_of fails to find ::memcpy in c++builder

Reported by: peter.myerscough-jackopson@… Owned by: Marshall Clow
Milestone: To Be Determined Component: algorithm
Version: Boost 1.44.0 Severity: Problem
Keywords: string_algo bug patch c++builder Cc:

Description

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 thishttp://mail-archives.apache.org/mod_mbox/xerces-c-users/200810.mbox/%3C48E5CA01.8050204@mebius.net%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

Change History (3)

comment:1 by Marshall Clow, 11 years ago

Component: string_algoalgorithm
Owner: changed from Pavol Droba to Marshall Clow

comment:2 by Marshall Clow, 11 years ago

(In [76213]) Qualified two calls to memcpy to work around a C++Builder bug; Refs #4811

comment:3 by Marshall Clow, 11 years ago

Resolution: fixed
Status: newclosed

(In [76265]) Merge Change 76213 to release; Fixes #4811

Note: See TracTickets for help on using tickets.