]> WPIA git - cassiopeia.git/commitdiff
upd: fix problem with tm-initializer
authorFelix Dörre <felix@dogcraft.de>
Mon, 9 Jan 2017 17:36:14 +0000 (18:36 +0100)
committerFelix Dörre <felix@dogcraft.de>
Mon, 9 Jan 2017 17:39:23 +0000 (18:39 +0100)
gcc's error message was: ISO C++ does not allow C99 designated initializers

Change-Id: I5d8869db0eb0707772a56d8262eb64f8bbc74029

src/util.cpp

index 95d1007695bafcfd040f1771a4de1801da1d8552..e721021b0de6d2105014ea4b05b42188010ab5b7 100644 (file)
@@ -89,12 +89,13 @@ std::pair<bool, time_t> parseDate( const std::string& date ) {
         return std::pair<bool, time_t>( 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();