diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index bea1e2f90..2acabd85b 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -67,6 +67,20 @@ POSSIBILITY OF SUCH DAMAGE. #endif #endif +// backwards compatibility with older versions of boost +#if !defined BOOST_SYMBOL_EXPORT && !defined BOOST_SYMBOL_IMPORT +# ifdef _MSC_VER +# define BOOST_SYMBOL_EXPORT __declspec(dllexport) +# define BOOST_SYMBOL_IMPORT __declspec(dllimport) +# elif __GNU__ >= 4 +# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default"))) +# define BOOST_SYMBOL_IMPORT __attribute__((visibility("default"))) +# else +# define BOOST_SYMBOL_EXPORT +# define BOOST_SYMBOL_IMPORT +# endif +#endif + #if defined TORRENT_BUILDING_SHARED # define TORRENT_EXPORT BOOST_SYMBOL_EXPORT #elif defined TORRENT_LINKING_SHARED diff --git a/src/asio.cpp b/src/asio.cpp index 2fa5ef975..58f5fa796 100644 --- a/src/asio.cpp +++ b/src/asio.cpp @@ -1,3 +1,7 @@ // builds all boost.asio source as a separate compilation unit -#include +#include + +#if BOOST_VERSION >= 104610 +#include +#endif