From 0493a91a42b5b50f094e2fb3e05bac43cb0f5bc1 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 11 Sep 2014 05:20:01 -0500 Subject: [PATCH] Boost 1.52 uses a completely different api for atomics. Not going to be supporting them. Also, fix llcalcparser in more old-boost compatible manner, and fix linux usage of apr_signal_description_get. --- indra/llcommon/llapp.cpp | 1 + indra/llcommon/llatomic.h | 2 +- indra/llcommon/llthread.h | 5 +-- indra/llmath/llcalcparser.h | 60 +++++++++++------------------- indra/newview/llmeshrepository.cpp | 2 +- 5 files changed, 27 insertions(+), 43 deletions(-) diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index c1f925428..8ae5141a1 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -66,6 +66,7 @@ bool windows_post_minidump_callback(const wchar_t* dump_path, #else # include # include // for fork() +# include "apr_signal.h" // for apr_signal_description_get(int signum) void setup_signals(); void default_unix_signal_handler(int signum, siginfo_t *info, void *); diff --git a/indra/llcommon/llatomic.h b/indra/llcommon/llatomic.h index 0cfe99c77..525deaa2a 100644 --- a/indra/llcommon/llatomic.h +++ b/indra/llcommon/llatomic.h @@ -46,7 +46,7 @@ //Prefer boost over stl over apr. -#if defined(USE_BOOST_ATOMIC) && (BOOST_VERSION >= 105200) +#if defined(USE_BOOST_ATOMIC) && (BOOST_VERSION >= 105300) #include "boost/atomic.hpp" template struct impl_atomic_type { typedef boost::atomic type; }; diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index a3f95e6d8..8dee66b34 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -210,7 +210,6 @@ typedef CONDITION_VARIABLE impl_cond_handle_type; //----APR specific------ #include "apr_thread_cond.h" #include "apr_thread_mutex.h" -#include "apr_signal.h" typedef LLAPRPool native_pool_type; typedef apr_thread_mutex_t* impl_mutex_handle_type; typedef apr_thread_cond_t* impl_cond_handle_type; @@ -662,10 +661,10 @@ private: // Simple responder for self destructing callbacks // Pure virtual class -class LL_COMMON_API LLResponder : public LLThreadSafeRefCount +class LLResponder : public LLThreadSafeRefCount { protected: - virtual ~LLResponder(); + virtual ~LLResponder() {} public: virtual void completed(bool success) = 0; }; diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h index 696e4a105..6e81605bb 100644 --- a/indra/llmath/llcalcparser.h +++ b/indra/llmath/llcalcparser.h @@ -54,54 +54,39 @@ T max_glue(T a, T b) { return std::max(a, b); } - -template -struct lazy_pow_ -{ - template struct result; - template - struct result - { - typedef T type; - }; - - T operator()(T x, T y) const - { - return std::pow(x, y); - } -}; - -template + +template struct lazy_ufunc_ { - template struct result; - template - struct result - { - typedef T type; - }; + typedef RT result_type; - T operator()(T(*fn)(T), T x) const + template + struct result { typedef RT type; }; + + template + RT operator()(F f, A1 a1) const { - return fn(x); + return f(a1); } }; -template +template struct lazy_bfunc_ { - template struct result; - template - struct result + typedef F32 result_type; + + template + struct result { typedef RT type; }; + + template + RT operator()(F f, A1 a1, A2 a2) const { - typedef T type; - }; - double operator()(T(*fn)(T, T), T x, T y) const - { - return fn(x, y); + return f(a1, a2); } }; +//} // end namespace anonymous + template struct grammar : boost::spirit::qi::grammar< @@ -187,10 +172,9 @@ struct grammar using boost::spirit::qi::no_case; using boost::spirit::qi::_val; - boost::phoenix::function< lazy_pow_ > lazy_pow; boost::phoenix::function< lazy_ufunc_ > lazy_ufunc; boost::phoenix::function< lazy_bfunc_ > lazy_bfunc; - + expression = term [_val = _1] >> *( ('+' >> term [_val += _1]) @@ -207,7 +191,7 @@ struct grammar factor = primary [_val = _1] - >> *( ("**" >> factor [_val = lazy_pow(_val, _1)]) + >> *( ("**" >> factor [_val = boost::phoenix::bind(static_cast(&std::pow),_val,_1)]) ) ; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 9f640b3f7..037c42664 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2334,7 +2334,7 @@ void LLMeshRepository::notifyLoadedMeshes() //call completed callbacks on finished decompositions mDecompThread->notifyCompleted(); - if (!mThread->mSignal->tryLock()) + if (!mThread->mSignal->try_lock()) { //curl thread is churning, wait for it to go idle return; }