diff --git a/include/boost/thread/detail/config.hpp b/include/boost/thread/detail/config.hpp index 40a8793e..94fb6b88 100644 --- a/include/boost/thread/detail/config.hpp +++ b/include/boost/thread/detail/config.hpp @@ -8,6 +8,14 @@ #define BOOST_THREAD_CONFIG_WEK01032003_HPP #include +#include + +#if BOOST_WORKAROUND(__BORLANDC__, < 0x600) +# pragma warn -8008 // Condition always true/false +# pragma warn -8080 // Identifier declared but never used +# pragma warn -8057 // Parameter never used +# pragma warn -8066 // Unreachable code +#endif // insist on threading support being available: #include diff --git a/include/boost/thread/tss.hpp b/include/boost/thread/tss.hpp index cf6d49b0..164fa85e 100644 --- a/include/boost/thread/tss.hpp +++ b/include/boost/thread/tss.hpp @@ -1,5 +1,5 @@ -// Copyright (C) 2001-2003 -// William E. Kempf +// Copyright (C) 2001-2003 William E. Kempf +// Copyright (C) 2006 Roland Schwarz // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -21,6 +21,13 @@ namespace boost { +// disable warnings about non dll import +// see: http://www.boost.org/more/separate_compilation.html#dlls +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4251 4231 4660 4275) +#endif + namespace detail { class BOOST_THREAD_DECL tss : private noncopyable @@ -38,7 +45,6 @@ public: throw boost::thread_resource_error(); } } - ~tss(); void* get() const; void set(void* value); @@ -99,6 +105,10 @@ private: detail::tss m_tss; }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + } // namespace boost #endif //BOOST_TSS_WEK070601_HPP diff --git a/src/mutex.inl b/src/mutex.inl index 4a295633..257556c8 100644 --- a/src/mutex.inl +++ b/src/mutex.inl @@ -3,6 +3,7 @@ // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// boostinspect:nounnamed namespace { diff --git a/src/timeconv.inl b/src/timeconv.inl index 47314619..2736e163 100644 --- a/src/timeconv.inl +++ b/src/timeconv.inl @@ -3,6 +3,7 @@ // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// boostinspect:nounnamed namespace { const int MILLISECONDS_PER_SECOND = 1000; diff --git a/src/tss_pe.cpp b/src/tss_pe.cpp index 060de55f..0e250092 100644 --- a/src/tss_pe.cpp +++ b/src/tss_pe.cpp @@ -16,7 +16,7 @@ //Definitions required by implementation - #if (_MSC_VER < 1310) // 1310 == VC++ 7.1 + #if (_MSC_VER < 1300) // 1300 == VC++ 7.0 typedef void (__cdecl *_PVFV)(void); #define INIRETSUCCESS #define PVAPI void @@ -48,7 +48,7 @@ //The .CRT$Xxx information is taken from Codeguru: //http://www.codeguru.com/Cpp/misc/misc/threadsprocesses/article.php/c6945__2/ - #if (_MSC_VER >= 1310) // 1310 == VC++ 7.1 + #if (_MSC_VER >= 1300) // 1300 == VC++ 7.0 # pragma data_seg(push, old_seg) #endif //Callback to run tls glue code first. @@ -78,7 +78,7 @@ #pragma data_seg(".CRT$XTU") static _PVFV p_process_term = on_process_term; #pragma data_seg() - #if (_MSC_VER >= 1310) // 1310 == VC++ 7.1 + #if (_MSC_VER >= 1300) // 1300 == VC++ 7.0 # pragma data_seg(pop, old_seg) #endif @@ -94,7 +94,7 @@ DWORD volatile dw = _tls_used; - #if (_MSC_VER < 1310) // 1310 == VC++ 7.1 + #if (_MSC_VER < 1300) // 1300 == VC++ 7.0 _TLSCB* pfbegin = __xl_a; _TLSCB* pfend = __xl_z; _TLSCB* pfdst = pfbegin; diff --git a/src/xtime.cpp b/src/xtime.cpp index 0732cf43..0ae854ff 100644 --- a/src/xtime.cpp +++ b/src/xtime.cpp @@ -22,6 +22,8 @@ # include #endif +#include + namespace boost { #ifdef BOOST_HAS_MPTASKS @@ -106,13 +108,23 @@ int xtime_get(struct xtime* xtp, int clock_type) return clock_type; #elif defined(BOOST_HAS_GETTIMEOFDAY) struct timeval tv; +# ifndef NDEBUG + int res = +#endif gettimeofday(&tv, 0); + assert(0 == res); + assert(tv.tv_sec >= 0); + assert(tv.tv_usec >= 0); xtp->sec = tv.tv_sec; xtp->nsec = tv.tv_usec * 1000; return clock_type; #elif defined(BOOST_HAS_CLOCK_GETTIME) timespec ts; +# ifndef NDEBUG + int res = +# endif clock_gettime(CLOCK_REALTIME, &ts); + assert(0 == res); xtp->sec = ts.tv_sec; xtp->nsec = ts.tv_nsec; return clock_type;