Boost logo

Boost :

Subject: [boost] bug-sprint #2114, 2 comments
From: Alexander Arhipenko (arhipjan_at_[hidden])
Date: 2009-06-09 04:39:02


I have 2 major comment on the updated patch.
Consider following snippet from gcc.hpp:
#if __GNUC__ >= 4 && !defined(__MINGW32__) && !defined(__CYGWIN__)
# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
# define BOOST_SYMBOL_HIDE __attribute__((visibility("hidden")))
# define BOOST_SYMBOL_IMPORT BOOST_SYMBOL_EXPORT

...And assume following scenario:
Someone is writing shared library (let's name it foo) with
'visilibility=hidden' option.
Library foo is using e.g. boost_filesystem.
In this case, all the symbols marked with BOOST_FILESYSTEM_DECL
will be exported from foo library.
This could easily break foo library's ABI (in case of migration to the
newest boost version etc.),
so BOOST_SYMBOL_IMPORT should be defined for gcc as empty macro:
# define BOOST_SYMBOL_IMPORT.

The second comment:
BOOST_EXCEPTION_EXPORT/IMPORT are intended for re-exporting exceptions
from shared library. So, they should be defined for gcc as:

# define BOOST_EXCEPTION_EXPORT BOOST_SYMBOL_EXPORT
# define BOOST_EXCEPTION_IMPORT BOOST_SYMBOL_EXPORT

and not as:

# define BOOST_EXCEPTION_EXPORT BOOST_SYMBOL_EXPORT
# define BOOST_EXCEPTION_IMPORT BOOST_SYMBOL_IMPORT

Note: for the current patch version this part works as expected,
since BOOST_SYMBOL_EXPORT == BOOST_SYMBOL_IMPORT for gcc.

See also this thread (search for exception):
http://lists.boost.org/Archives/boost/2008/12/146068.php

Regards


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