diff options
author | Kenneth Heafield <github@kheafield.com> | 2013-01-20 16:25:58 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2013-01-20 16:25:58 +0400 |
commit | a52d97f99f743b81781d1106c9a17266b901ee6f (patch) | |
tree | aac20d2a0467284b70da1e9a7203c9364f8e459f /util | |
parent | 8a3b93c72e7b24a6a1bf8a0fd409765539cbc507 (diff) |
Cross platform fixes
Diffstat (limited to 'util')
-rw-r--r-- | util/stream/Jamfile | 12 | ||||
-rw-r--r-- | util/stream/sort.hh | 8 | ||||
-rw-r--r-- | util/stream/timer.hh | 8 |
3 files changed, 16 insertions, 12 deletions
diff --git a/util/stream/Jamfile b/util/stream/Jamfile index 469f58762..2e99979f5 100644 --- a/util/stream/Jamfile +++ b/util/stream/Jamfile @@ -1,10 +1,10 @@ -if $(BOOST-VERSION) >= 104800 { - timer-link = <library>/top//boost_timer ; -} else { - timer-link = ; -} +#if $(BOOST-VERSION) >= 104800 { +# timer-link = <library>/top//boost_timer ; +#} else { +# timer-link = ; +#} -fakelib stream : chain.cc io.cc line_input.cc multi_progress.cc ..//kenutil /top//boost_thread : : : <library>/top//boost_thread $(timer-link) ; +fakelib stream : chain.cc io.cc line_input.cc multi_progress.cc ..//kenutil /top//boost_thread : : : <library>/top//boost_thread ; import testing ; unit-test io_test : io_test.cc stream /top//boost_unit_test_framework ; diff --git a/util/stream/sort.hh b/util/stream/sort.hh index f25993129..a86f160f2 100644 --- a/util/stream/sort.hh +++ b/util/stream/sort.hh @@ -259,7 +259,9 @@ template <class Compare, class Combine> class MergingReader { while (in_offsets_->RemainingBlocks()) { // Use bigger buffers if there's less remaining. - uint64_t per_buffer = std::max(buffer_size_, total_memory_ / in_offsets_->RemainingBlocks()); + uint64_t per_buffer = static_cast<uint64_t>(std::max<std::size_t>( + buffer_size_, + static_cast<std::size_t>((static_cast<uint64_t>(total_memory_) / in_offsets_->RemainingBlocks())))); per_buffer -= per_buffer % entry_size; assert(per_buffer); @@ -325,8 +327,8 @@ template <class Compare, class Combine> class MergingReader { private: Offsets *out_offsets_; - uint64_t buffer_size_; - uint64_t total_memory_; + std::size_t buffer_size_; + std::size_t total_memory_; }; // The lazy step owns the remaining files. This keeps track of them. diff --git a/util/stream/timer.hh b/util/stream/timer.hh index 50e94fe8a..7e1a5885d 100644 --- a/util/stream/timer.hh +++ b/util/stream/timer.hh @@ -1,14 +1,16 @@ #ifndef UTIL_STREAM_TIMER__ #define UTIL_STREAM_TIMER__ -#include <boost/version.hpp> +// Sorry Jon, this was adding library dependencies in Moses and people complained. + +/*#include <boost/version.hpp> #if BOOST_VERSION >= 104800 #include <boost/timer/timer.hpp> #define UTIL_TIMER(str) boost::timer::auto_cpu_timer timer(std::cerr, 1, (str)) #else -//#warning Using Boost older than 1.48. Timing information will not be available. +//#warning Using Boost older than 1.48. Timing information will not be available.*/ #define UTIL_TIMER(str) -#endif +//#endif #endif // UTIL_STREAM_TIMER__ |