From 8efcd6124e1d02bd6427ded015be603037770883 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Mon, 9 Jan 2017 18:36:14 +0100 Subject: [PATCH] upd: fix problem with tm-initializer gcc's error message was: ISO C++ does not allow C99 designated initializers Change-Id: I5d8869db0eb0707772a56d8262eb64f8bbc74029 --- src/util.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 95d1007..e721021 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -89,12 +89,13 @@ std::pair parseDate( const std::string& date ) { return std::pair( false, 0 ); } - std::tm t = { - .tm_sec = 0, .tm_min = 0, .tm_hour = 0, - .tm_mday = std::stoi( date.substr( 8, 2 ) ), - .tm_mon = std::stoi( date.substr( 5, 2 ) ) - 1, - .tm_year = std::stoi( date.substr( 0, 4 ) ) - 1900 - }; + std::tm t = {}; + t.tm_sec = 0; + t.tm_min = 0; + t.tm_hour = 0; + t.tm_mday = std::stoi( date.substr( 8, 2 ) ); + t.tm_mon = std::stoi( date.substr( 5, 2 ) ) - 1; + t.tm_year = std::stoi( date.substr( 0, 4 ) ) - 1900; setenv( "TZ", "UTC", 1 ); tzset(); -- 2.39.5