diff --git a/Changes b/Changes index 6bd421472..371bd6d57 100644 --- a/Changes +++ b/Changes @@ -14,6 +14,7 @@ Verilator 4.221 devel **Minor:** * Split --prof-threads into --prof-exec and --prof-pgo (#3365). [Geza Lore, Shunyao CAD] +* Fix MSVC localtime_s (#3124). Verilator 4.220 2022-03-12 diff --git a/include/verilatedos.h b/include/verilatedos.h index 324cc4332..5ba920312 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -492,10 +492,8 @@ using ssize_t = uint32_t; ///< signed size_t; returned from read() # define VL_STRCASECMP strcasecmp #endif -#ifdef __MINGW32__ +#if defined(__MINGW32__) || defined(_MSC_VER) # define VL_LOCALTIME_R(timep, tmp) localtime_s((tmp), (timep)) -#elif defined(_MSC_VER) -# define VL_LOCALTIME_R(timep, tmp) localtime_c((tmp), (timep)) #else # define VL_LOCALTIME_R(timep, tmp) localtime_r((timep), (tmp)) #endif diff --git a/src/V3Param.cpp b/src/V3Param.cpp index cdb4ce9a2..02f545516 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -58,6 +58,7 @@ #include "V3Unroll.h" #include "V3Hasher.h" +#include #include #include #include