mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 06:34:42 +02:00
tests: Remove GCC compatibility from make_tm
We're using C++17, GCC only started implementing that in version 5, so there's no need for compatibility code for older versions any more.
This commit is contained in:
parent
de4b58a04f
commit
2458f686db
@ -23,13 +23,8 @@ tm make_tm(std::string s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::tm t = {};
|
std::tm t = {};
|
||||||
#if defined(__GNUC__) && __GNUC__ < 5
|
|
||||||
// GCC did not implement std::get_time() until version 5
|
|
||||||
strptime(s.c_str(), "%Y-%m-%d %H:%M:%S", &t);
|
|
||||||
#else /* defined(__GNUC__) && __GNUC__ < 5 */
|
|
||||||
std::istringstream stream(s);
|
std::istringstream stream(s);
|
||||||
stream >> std::get_time(&t, "%Y-%m-%d %H:%M:%S");
|
stream >> std::get_time(&t, "%Y-%m-%d %H:%M:%S");
|
||||||
#endif /* defined(__GNUC__) && __GNUC__ < 5 */
|
|
||||||
t.tm_isdst = dst;
|
t.tm_isdst = dst;
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user