diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index a80a0b09a..b24efb778 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -116,6 +116,13 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_BEOS #include // B_PATH_NAME_LENGTH #define TORRENT_HAS_FALLOCATE 0 +#if __GNUCC__ == 2 +# if defined(TORRENT_BUILDING_SHARED) +# define TORRENT_EXPORT __declspec(dllexport) +# elif defined(TORRENT_LINKING_SHARED) +# define TORRENT_EXPORT __declspec(dllimport) +# endif +#endif #else #warning unknown OS, assuming BSD #define TORRENT_BSD diff --git a/include/libtorrent/thread.hpp b/include/libtorrent/thread.hpp index 33e349622..2c417098a 100644 --- a/include/libtorrent/thread.hpp +++ b/include/libtorrent/thread.hpp @@ -44,15 +44,22 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#ifdef TORRENT_BEOS +#include +#endif + namespace libtorrent { typedef boost::asio::detail::thread thread; typedef boost::asio::detail::mutex mutex; typedef boost::asio::detail::event condition; + inline void sleep(int milliseconds) { #if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN Sleep(milliseconds); +#elif defined TORRENT_BEOS + snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE); #else usleep(milliseconds * 1000); #endif diff --git a/src/allocator.cpp b/src/allocator.cpp index c452f3f04..7918a8e08 100644 --- a/src/allocator.cpp +++ b/src/allocator.cpp @@ -35,6 +35,8 @@ POSSIBILITY OF SUCH DAMAGE. #ifdef TORRENT_WINDOWS #include +#elif defined TORRENT_BEOS +#include #else #include #include // _SC_PAGESIZE @@ -52,6 +54,8 @@ namespace libtorrent SYSTEM_INFO si; GetSystemInfo(&si); s = si.dwPageSize; +#elif defined TORRENT_BEOS + s = B_PAGE_SIZE; #else s = sysconf(_SC_PAGESIZE); #endif