time/Convert: add `noexcept`

This commit is contained in:
Max Kellermann 2019-05-08 16:09:27 +02:00
parent e7411c0c4b
commit 80e55f6bfc
2 changed files with 4 additions and 4 deletions

View File

@ -69,7 +69,7 @@ LocalTime(std::chrono::system_clock::time_point tp)
#ifdef __GLIBC__
std::chrono::system_clock::time_point
TimeGm(struct tm &tm)
TimeGm(struct tm &tm) noexcept
{
return std::chrono::system_clock::from_time_t(timegm(&tm));
}
@ -77,7 +77,7 @@ TimeGm(struct tm &tm)
#endif
std::chrono::system_clock::time_point
MakeTime(struct tm &tm)
MakeTime(struct tm &tm) noexcept
{
return std::chrono::system_clock::from_time_t(mktime(&tm));
}

View File

@ -56,7 +56,7 @@ LocalTime(std::chrono::system_clock::time_point tp);
*/
gcc_pure
std::chrono::system_clock::time_point
TimeGm(struct tm &tm);
TimeGm(struct tm &tm) noexcept;
#endif
@ -65,6 +65,6 @@ TimeGm(struct tm &tm);
*/
gcc_pure
std::chrono::system_clock::time_point
MakeTime(struct tm &tm);
MakeTime(struct tm &tm) noexcept;
#endif