From 4e39027958f0f7040fc20a126570cadf39e7eff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Thu, 7 Nov 2019 13:23:50 -0500 Subject: [PATCH] Fix Linux build, thanks Router~ --- indra/newview/llfloaterregioninfo.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index fb12e4b24..b6aeadc68 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -4121,6 +4121,27 @@ const std::string& getNAString() return na; } +#if defined(__GNUC__) && __GNUC__ < 5 // On GCC 4, implement std::get_time using strptime +#include + +namespace std +{ + struct get_time + { + tm* mTime; + const char* mFmt; + get_time(tm* time, const char* fmt) : mTime(time), mFmt(fmt) {} + }; + + istringstream& operator>>(istringstream&& str, get_time&& rhs) + { + if (!strptime(str.str().data(), rhs.mFmt, rhs.mTime)) + str.setstate(ios_base::failbit); + return str; + } +} +#endif + void handlePseudoISO8601(const std::string& date_str, LLSD& column, const std::string& fmt) { if (date_str.front() == '0') // server returns the "0000-00-00 00:00:00" date in case it doesn't know it