diff options
Diffstat (limited to 'external')
-rw-r--r-- | external/boost/archive/portable_binary_archive.hpp | 2 | ||||
-rw-r--r-- | external/boost/archive/portable_binary_iarchive.hpp | 6 | ||||
-rw-r--r-- | external/boost/archive/portable_binary_oarchive.hpp | 4 | ||||
-rw-r--r-- | external/easylogging++/easylogging++.cc | 37 | ||||
-rw-r--r-- | external/easylogging++/easylogging++.h | 4 |
5 files changed, 32 insertions, 21 deletions
diff --git a/external/boost/archive/portable_binary_archive.hpp b/external/boost/archive/portable_binary_archive.hpp index e940c5b9e..7ae01a225 100644 --- a/external/boost/archive/portable_binary_archive.hpp +++ b/external/boost/archive/portable_binary_archive.hpp @@ -22,7 +22,7 @@ #endif
#include <boost/archive/basic_archive.hpp>
-#include <boost/detail/endian.hpp>
+#include <boost/predef/other/endian.h>
#include <boost/archive/impl/archive_serializer_map.ipp>
diff --git a/external/boost/archive/portable_binary_iarchive.hpp b/external/boost/archive/portable_binary_iarchive.hpp index 7792b530d..bd19599f3 100644 --- a/external/boost/archive/portable_binary_iarchive.hpp +++ b/external/boost/archive/portable_binary_iarchive.hpp @@ -226,7 +226,7 @@ public: #include <istream>
#include <string>
-#include <boost/detail/endian.hpp>
+#include <boost/predef/other/endian.h>
#include <boost/serialization/throw_exception.hpp>
#include <boost/archive/archive_exception.hpp>
@@ -252,12 +252,12 @@ portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){ );
char * cptr = reinterpret_cast<char *>(& l);
- #ifdef BOOST_BIG_ENDIAN
+ #if BOOST_ENDIAN_BIG_BYTE
cptr += (sizeof(boost::intmax_t) - size);
#endif
this->primitive_base_t::load_binary(cptr, size);
- #ifdef BOOST_BIG_ENDIAN
+ #if BOOST_ENDIAN_BIG_BYTE
if(m_flags & endian_little)
#else
if(m_flags & endian_big)
diff --git a/external/boost/archive/portable_binary_oarchive.hpp b/external/boost/archive/portable_binary_oarchive.hpp index e2dcb9456..783c7f7c9 100644 --- a/external/boost/archive/portable_binary_oarchive.hpp +++ b/external/boost/archive/portable_binary_oarchive.hpp @@ -221,7 +221,7 @@ public: // See http://www.boost.org for updates, documentation, and revision history.
#include <ostream>
-#include <boost/detail/endian.hpp>
+#include <boost/predef/other/endian.h>
namespace boost { namespace archive {
@@ -258,7 +258,7 @@ portable_binary_oarchive::save_impl( else
ll = l;
char * cptr = reinterpret_cast<char *>(& ll);
- #ifdef BOOST_BIG_ENDIAN
+ #if BOOST_ENDIAN_BIG_BYTE
cptr += (sizeof(boost::intmax_t) - size);
if(m_flags & endian_little)
reverse_bytes(size, cptr);
diff --git a/external/easylogging++/easylogging++.cc b/external/easylogging++/easylogging++.cc index 5a806dc69..2b4c7bbbf 100644 --- a/external/easylogging++/easylogging++.cc +++ b/external/easylogging++/easylogging++.cc @@ -1969,7 +1969,7 @@ void RegisteredLoggers::unsafeFlushAll(void) { // VRegistry -VRegistry::VRegistry(base::type::VerboseLevel level, base::type::EnumType* pFlags) : m_level(level), m_pFlags(pFlags) { +VRegistry::VRegistry(base::type::VerboseLevel level, base::type::EnumType* pFlags) : m_level(level), m_pFlags(pFlags), m_lowest_priority(INT_MAX) { } /// @brief Sets verbose level. Accepted range is 0-9 @@ -2053,14 +2053,30 @@ void VRegistry::setModules(const char* modules) { } } +// Log levels are sorted in a weird way... +static int priority(Level level) { + if (level == Level::Fatal) return 0; + if (level == Level::Error) return 1; + if (level == Level::Warning) return 2; + if (level == Level::Info) return 3; + if (level == Level::Debug) return 4; + if (level == Level::Verbose) return 5; + if (level == Level::Trace) return 6; + return 7; +} + void VRegistry::setCategories(const char* categories, bool clear) { base::threading::ScopedLock scopedLock(lock()); auto insert = [&](std::stringstream& ss, Level level) { m_categories.push_back(std::make_pair(ss.str(), level)); m_cached_allowed_categories.clear(); + int pri = priority(level); + if (pri > m_lowest_priority) + m_lowest_priority = pri; }; if (clear) { + m_lowest_priority = 0; m_categories.clear(); m_cached_allowed_categories.clear(); m_categoriesString.clear(); @@ -2117,23 +2133,14 @@ std::string VRegistry::getCategories() { return m_categoriesString; } -// Log levels are sorted in a weird way... -static int priority(Level level) { - if (level == Level::Fatal) return 0; - if (level == Level::Error) return 1; - if (level == Level::Warning) return 2; - if (level == Level::Info) return 3; - if (level == Level::Debug) return 4; - if (level == Level::Verbose) return 5; - if (level == Level::Trace) return 6; - return 7; -} - bool VRegistry::allowed(Level level, const std::string &category) { + const int pri = priority(level); + if (pri > m_lowest_priority) + return false; base::threading::ScopedLock scopedLock(lock()); const std::map<std::string, int>::const_iterator it = m_cached_allowed_categories.find(category); if (it != m_cached_allowed_categories.end()) - return priority(level) <= it->second; + return pri <= it->second; if (m_categories.empty()) { return false; } else { @@ -2142,7 +2149,7 @@ bool VRegistry::allowed(Level level, const std::string &category) { if (base::utils::Str::wildCardMatch(category.c_str(), it->first.c_str())) { const int p = priority(it->second); m_cached_allowed_categories.insert(std::make_pair(category, p)); - return priority(level) <= p; + return pri <= p; } } m_cached_allowed_categories.insert(std::make_pair(category, -1)); diff --git a/external/easylogging++/easylogging++.h b/external/easylogging++/easylogging++.h index f0d8d5df7..f1fa2cb0d 100644 --- a/external/easylogging++/easylogging++.h +++ b/external/easylogging++/easylogging++.h @@ -359,6 +359,7 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre #if defined(ELPP_SYSLOG) # include <syslog.h> #endif // defined(ELPP_SYSLOG) +#include <climits> #include <ctime> #include <cstring> #include <cstdlib> @@ -406,6 +407,7 @@ ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStre #include <sstream> #include <memory> #include <type_traits> +#include <atomic> #if ELPP_THREADING_ENABLED # if ELPP_USE_STD_THREADING # include <mutex> @@ -2451,6 +2453,7 @@ class VRegistry : base::NoCopy, public base::threading::ThreadSafe { base::threading::ScopedLock scopedLock(lock()); m_categories.clear(); m_cached_allowed_categories.clear(); + m_lowest_priority = INT_MAX; } inline void clearModules(void) { @@ -2495,6 +2498,7 @@ class VRegistry : base::NoCopy, public base::threading::ThreadSafe { std::map<std::string, int> m_cached_allowed_categories; std::string m_categoriesString; std::string m_filenameCommonPrefix; + std::atomic<int> m_lowest_priority; }; } // namespace base class LogMessage { |