use strftime instead of put_time for gcc 4.8 compatibility
authorN. Engelhardt <nak@symbioticeda.com>
Wed, 21 Oct 2020 15:47:00 +0000 (17:47 +0200)
committerN. Engelhardt <nak@symbioticeda.com>
Wed, 21 Oct 2020 15:47:00 +0000 (17:47 +0200)
passes/sat/sim.cc

index dad0d0c2444585478a1524c7825b5cf6ccd12804..3d2081a74818310b0e276a47796f2ceca383b531 100644 (file)
@@ -22,7 +22,6 @@
 #include "kernel/celltypes.h"
 
 #include <ctime>
-#include <iomanip>
 
 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());