From 8436c4d271ea7fa63fe488e0b34c1ada698c73e0 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 16 Aug 2002 15:55:19 +0000 Subject: [PATCH] #pragma option -pc around use_count_is_zero added for Borland 5.5.1, to enable compilation with -ps set. [SVN r14927] --- include/boost/detail/shared_count.hpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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: