Skip to content
Snippets Groups Projects
Commit b88fb2f1 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[App] fixed compilation with old gcc

parent a7672074
No related branches found
No related tags found
No related merge requests found
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include <chrono> #include <chrono>
#include <ctime> #include <ctime>
#include <iomanip>
#include <sstream>
// ThirdParty/tclap // ThirdParty/tclap
#include "tclap/CmdLine.h" #include "tclap/CmdLine.h"
...@@ -85,9 +83,11 @@ int main(int argc, char *argv[]) ...@@ -85,9 +83,11 @@ int main(int argc, char *argv[])
{ {
auto const start_time_sys = std::chrono::system_clock::to_time_t( auto const start_time_sys = std::chrono::system_clock::to_time_t(
std::chrono::system_clock::now()); std::chrono::system_clock::now());
std::ostringstream sstr; char time_str[100];
sstr << std::put_time(std::localtime(&start_time_sys), "%F %T %z"); if (std::strftime(time_str, sizeof(time_str), "%F %T %z",
INFO("OGS started on %s.", sstr.str().c_str()); std::localtime(&start_time_sys))) {
INFO("OGS started on %s.", time_str);
}
} }
std::chrono::steady_clock::now(); std::chrono::steady_clock::now();
...@@ -146,9 +146,11 @@ int main(int argc, char *argv[]) ...@@ -146,9 +146,11 @@ int main(int argc, char *argv[])
{ {
auto const end_time_sys = std::chrono::system_clock::to_time_t( auto const end_time_sys = std::chrono::system_clock::to_time_t(
std::chrono::system_clock::now()); std::chrono::system_clock::now());
std::ostringstream sstr; char time_str[100];
sstr << std::put_time(std::localtime(&end_time_sys), "%F %T %z"); if (std::strftime(time_str, sizeof(time_str), "%F %T %z",
INFO("OGS terminated on %s.", sstr.str().c_str()); std::localtime(&end_time_sys))) {
INFO("OGS terminated on %s.", time_str);
}
INFO("[time] Execution took %g s.", run_time.elapsed()); INFO("[time] Execution took %g s.", run_time.elapsed());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment