From: N. Engelhardt Date: Wed, 21 Oct 2020 15:47:00 +0000 (+0200) Subject: use strftime instead of put_time for gcc 4.8 compatibility X-Git-Tag: working-ls180~222^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c96a0b1d5da678a86e9d3b1b1f56390d38600f3;p=yosys.git use strftime instead of put_time for gcc 4.8 compatibility --- diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index dad0d0c24..3d2081a74 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -22,7 +22,6 @@ #include "kernel/celltypes.h" #include -#include USING_YOSYS_NAMESPACE PRIVATE_NAMESPACE_BEGIN @@ -649,10 +648,12 @@ struct SimWorker : SimShared return; vcdfile << stringf("$version %s $end\n", yosys_version_str); - vcdfile << stringf("$date "); + std::time_t t = std::time(nullptr); - vcdfile << std::put_time(std::localtime(&t), "%c %Z"); - vcdfile << stringf(" $end\n"); + char mbstr[255]; + if (std::strftime(mbstr, sizeof(mbstr), "%c", std::localtime(&t))) { + vcdfile << stringf("$date ") << mbstr << stringf(" $end\n"); + } if (!timescale.empty()) vcdfile << stringf("$timescale %s $end\n", timescale.c_str());