From cef0105dfc0d5b3648865a91ecf00b02f66dd1aa Mon Sep 17 00:00:00 2001 From: Stephen Henry Date: Sun, 17 May 2020 16:44:42 +0100 Subject: [PATCH] Fix requiring C++11 algorithms. (#2339) (#2340) --- include/verilated_imp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/verilated_imp.h b/include/verilated_imp.h index 23214bddd..d19d994e5 100644 --- a/include/verilated_imp.h +++ b/include/verilated_imp.h @@ -242,7 +242,7 @@ public: // But only for verilated*.cpp s_s.m_fdps.resize(31); std::fill(s_s.m_fdps.begin(), s_s.m_fdps.end(), (FILE*)0); s_s.m_fdFreeMct.resize(30); - std::iota(s_s.m_fdFreeMct.begin(), s_s.m_fdFreeMct.end(), 1); + for (int i = 0, id = 1; i < s_s.m_fdFreeMct.size(); i++, id++) { s_s.m_fdFreeMct[i] = id; } } ~VerilatedImp() {} @@ -472,7 +472,9 @@ public: // But only for verilated*.cpp s_s.m_fdps.resize(start + excess); std::fill(s_s.m_fdps.begin() + start, s_s.m_fdps.end(), (FILE*)0); s_s.m_fdFree.resize(excess); - std::iota(s_s.m_fdFree.begin(), s_s.m_fdFree.end(), start); + for (int i = 0, id = start; i < s_s.m_fdFree.size(); i++, id++) { + s_s.m_fdFree[i] = id; + } } IData idx = s_s.m_fdFree.back(); s_s.m_fdFree.pop_back();