diff --git a/include/boost/detail/shared_count.hpp b/include/boost/detail/shared_count.hpp index 17aeb9d..299fadb 100644 --- a/include/boost/detail/shared_count.hpp +++ b/include/boost/detail/shared_count.hpp @@ -38,16 +38,31 @@ namespace boost { +// The standard library that comes with Borland C++ 5.5.1 +// defines std::exception and its members as having C calling +// convention (-pc). When the definition of use_count_is_zero +// is compiled with -ps, the compiler issues an error. +// Hence, the temporary #pragma option -pc below. The version +// check is deliberately conservative. + +#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 +# pragma option push -pc +#endif + class use_count_is_zero: public std::exception { public: virtual char const * what() const throw() { - return "use_count_is_zero"; + return "boost::use_count_is_zero"; } }; +#if defined(__BORLANDC__) && __BORLANDC__ == 0x551 +# pragma option pop +#endif + class counted_base { private: