diff --git a/Jamfile b/Jamfile index 047bef651..f112e398e 100755 --- a/Jamfile +++ b/Jamfile @@ -100,7 +100,7 @@ rule linking ( properties * ) if beos in $(properties) { - result += netkit ; + result += netkit gcc ; } if solaris in $(properties) @@ -342,6 +342,7 @@ lib gdi32 : : gdi32 ; # required for networking on beos lib netkit : : net /boot/system/lib shared ; +lib gcc : : gcc static ; # when using iconv lib libiconv : : iconv shared ; diff --git a/examples/client_test.cpp b/examples/client_test.cpp index e5fda80b3..3ac3931c8 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1877,7 +1877,7 @@ int main(int argc, char* argv[]) , esc("37"), s.distributed_copies, esc("0") , s.sparse_regions , esc("32"), add_suffix(s.download_rate, "/s").c_str(), esc("0") - , esc("37"), t.hours(), t.minutes(), t.seconds(), esc("0") + , esc("37"), int(t.hours()), int(t.minutes()), int(t.seconds()), esc("0") , esc("36"), s.current_tracker.c_str(), esc("0")); out += str; ++lines_printed; diff --git a/examples/rss_reader.cpp b/examples/rss_reader.cpp index df363153f..277fdceb6 100644 --- a/examples/rss_reader.cpp +++ b/examples/rss_reader.cpp @@ -3,6 +3,7 @@ #include "libtorrent/session.hpp" #include "libtorrent/bencode.hpp" #include +#include using namespace libtorrent; @@ -65,7 +66,7 @@ int main(int argc, char* argv[]) { if ((argc == 2 && strcmp(argv[1], "--help") == 0) || argc > 2) { - std::cerr << "usage: rss_reader [rss-url]\n"; + fprintf(stderr, "usage: rss_reader [rss-url]\n"); return 0; } diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 49cce243f..80809f7be 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -182,8 +182,6 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_USE_GETADAPTERSADDRESSES 1 #define TORRENT_HAS_SALEN 0 // windows has its own functions to convert -// apple uses utf-8 as its locale, so no conversion -// is necessary #ifndef TORRENT_USE_ICONV #define TORRENT_USE_ICONV 0 #define TORRENT_USE_LOCALE 1 diff --git a/include/libtorrent/thread.hpp b/include/libtorrent/thread.hpp index c91f1532a..c59d546e6 100644 --- a/include/libtorrent/thread.hpp +++ b/include/libtorrent/thread.hpp @@ -40,6 +40,10 @@ POSSIBILITY OF SUCH DAMAGE. #include #endif +#if defined TORRENT_BEOS +#include +#endif + #include // for auto_ptr required by asio #include @@ -67,6 +71,10 @@ namespace libtorrent HANDLE m_sem; mutex m_mutex; int m_num_waiters; +#elif defined TORRENT_BEOS + sem_id m_sem; + mutex m_mutex; + int m_num_waiters; #else #error not implemented #endif diff --git a/include/libtorrent/xml_parse.hpp b/include/libtorrent/xml_parse.hpp index 8002582ea..f509c90ea 100644 --- a/include/libtorrent/xml_parse.hpp +++ b/include/libtorrent/xml_parse.hpp @@ -36,6 +36,8 @@ POSSIBILITY OF SUCH DAMAGE. #include #include +#include "libtorrent/escape_string.hpp" + namespace libtorrent { enum diff --git a/src/sha1.cpp b/src/sha1.cpp index 39e41fec5..e9d90006e 100644 --- a/src/sha1.cpp +++ b/src/sha1.cpp @@ -131,10 +131,13 @@ namespace { using namespace std; printf("%s (%d,%d) %x %x %x %x %x\n" - , msg, context->count[0], context->count[1] - , context->state[0], context->state[1] - , context->state[2], context->state[3] - , context->state[4]); + , msg, (unsigned int)context->count[0] + , (unsigned int)context->count[1] + , (unsigned int)context->state[0] + , (unsigned int)context->state[1] + , (unsigned int)context->state[2] + , (unsigned int)context->state[3] + , (unsigned int)context->state[4]); } template diff --git a/src/thread.cpp b/src/thread.cpp index 39fda92c1..0ba0c9c13 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -101,6 +101,33 @@ namespace libtorrent TORRENT_ASSERT(l.locked()); ReleaseSemaphore(m_sem, m_num_waiters, 0); } +#elif defined TORRENT_BEOS + condition::condition() + : m_num_waiters(0) + { + m_sem = create_sem(0, 0); + } + + condition::~condition() + { + delete_sem(m_sem); + } + + void condition::wait(mutex::scoped_lock& l) + { + TORRENT_ASSERT(l.locked()); + ++m_num_waiters; + l.unlock(); + acquire_sem(m_sem); + l.lock(); + --m_num_waiters; + } + + void condition::signal_all(mutex::scoped_lock& l) + { + TORRENT_ASSERT(l.locked()); + release_sem_etc(m_sem, m_num_waiters, 0); + } #else #error not implemented #endif diff --git a/src/torrent.cpp b/src/torrent.cpp index 425307cec..40f76969c 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -2670,7 +2670,7 @@ namespace libtorrent for (std::map::iterator i = downloading_piece.begin(); i != downloading_piece.end(); ++i) { - fprintf(stderr, " %d:%d %d\n", i->first.piece_index, i->first.block_index, i->second); + fprintf(stderr, " %d:%d %d\n", int(i->first.piece_index), int(i->first.block_index), i->second); } }