Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-15 12:13:14


On Borland, <exception> defines std::exception::what() (among other things)
as having C calling convention, regardless of the default (specified on the
command line.)

When code tries to derive from std::exception (boost::use_count_is_zero is
an example), it defines ::what() with the default calling convention, and
the compiler issues an error when the default is, for example, stdcall (-ps)
and not C (-pc).

It is possible to work around the problem by surrounding the class
definition with

#ifdef __BORLANDC__
# pragma option push -pc
#endif

// ...

#ifdef __BORLANDC__
# pragma option pop
#endif

but is this the "correct" fix? Opinions? (Incidentally, the test framework
has the same problem with -ps on Borland; it is possible that other places
in Boost are also affected.)

--
Peter Dimov
http://www.mmltd.net/pdimov

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk