diff --git a/include/verilated_vcd_c.cpp b/include/verilated_vcd_c.cpp index 57bd4cf6f..9c442d692 100644 --- a/include/verilated_vcd_c.cpp +++ b/include/verilated_vcd_c.cpp @@ -260,10 +260,10 @@ void VerilatedVcd::bufferFlush () { if (VL_UNLIKELY(!isOpen())) return; char* wp = m_wrBufp; while (1) { - size_t remaining = (m_writep - wp); + ssize_t remaining = (m_writep - wp); if (remaining==0) break; errno = 0; - int got = write (m_fd, wp, remaining); + ssize_t got = write (m_fd, wp, remaining); if (got>0) { wp += got; m_wroteBytes += got; diff --git a/include/verilatedos.h b/include/verilatedos.h index 07c01ec2e..124004d6b 100644 --- a/include/verilatedos.h +++ b/include/verilatedos.h @@ -146,6 +146,14 @@ typedef unsigned __int32 vluint32_t; ///< 32-bit unsigned type typedef signed __int64 vlsint64_t; ///< 64-bit signed type typedef unsigned __int64 vluint64_t; ///< 64-bit unsigned type +# ifndef _SSIZE_T_DEFINED +# ifdef _WIN64 +typedef signed __int64 ssize_t; ///< signed size_t; returned from read() +# else +typedef signed __int32 ssize_t; ///< signed size_t; returned from read() +# endif +# endif + #else // Linux or compliant Unix flavors, -m64 # include // Linux and most flavors diff --git a/test_regress/t/t_dpi_context_c.cpp b/test_regress/t/t_dpi_context_c.cpp index 075c77ffd..3610be8b4 100644 --- a/test_regress/t/t_dpi_context_c.cpp +++ b/test_regress/t/t_dpi_context_c.cpp @@ -14,7 +14,7 @@ //************************************************************************* #include -#include +#include "svdpi.h" //====================================================================== diff --git a/test_regress/t/t_dpi_display_c.cpp b/test_regress/t/t_dpi_display_c.cpp index 914782add..94dbd91a2 100644 --- a/test_regress/t/t_dpi_display_c.cpp +++ b/test_regress/t/t_dpi_display_c.cpp @@ -14,7 +14,7 @@ //************************************************************************* #include -#include +#include "svdpi.h" //====================================================================== diff --git a/test_regress/t/t_dpi_export_c.cpp b/test_regress/t/t_dpi_export_c.cpp index b9cb572b7..e6d16f344 100644 --- a/test_regress/t/t_dpi_export_c.cpp +++ b/test_regress/t/t_dpi_export_c.cpp @@ -14,8 +14,8 @@ //************************************************************************* #include -#include #include +#include "svdpi.h" #ifdef _WIN32 # define T_PRI64 "I64" diff --git a/test_regress/t/t_dpi_import_c.cpp b/test_regress/t/t_dpi_import_c.cpp index 053ab3f40..70d95cfa8 100644 --- a/test_regress/t/t_dpi_import_c.cpp +++ b/test_regress/t/t_dpi_import_c.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include "svdpi.h" //====================================================================== diff --git a/test_regress/t/t_dpi_sys_c.cpp b/test_regress/t/t_dpi_sys_c.cpp index da380e7eb..b7473d15e 100644 --- a/test_regress/t/t_dpi_sys_c.cpp +++ b/test_regress/t/t_dpi_sys_c.cpp @@ -14,7 +14,7 @@ //************************************************************************* #include -#include +#include "svdpi.h" //====================================================================== diff --git a/test_regress/t/t_flag_ldflags_c.cpp b/test_regress/t/t_flag_ldflags_c.cpp index 2cb0db795..ebb86803e 100644 --- a/test_regress/t/t_flag_ldflags_c.cpp +++ b/test_regress/t/t_flag_ldflags_c.cpp @@ -14,7 +14,7 @@ //************************************************************************* #include -#include +#include "svdpi.h" //======================================================================