diff --git a/driver/main.c b/driver/main.c index a8ab8066e..931b62639 100644 --- a/driver/main.c +++ b/driver/main.c @@ -329,6 +329,9 @@ static int t_default(char*cmd, unsigned ncmd) remove(source_path); if ( ! getenv("IVERILOG_ICONFIG")) remove(iconfig_path); +#ifdef __MINGW32__ /* MinGW just returns the exit status, so return it! */ + return rc; +#else if (rc != 0) { if (rc == 127) { fprintf(stderr, "Failed to execute: %s\n", cmd); @@ -343,6 +346,7 @@ static int t_default(char*cmd, unsigned ncmd) } return 0; +#endif } diff --git a/vvp/vpi_mcd.cc b/vvp/vpi_mcd.cc index 4fc328745..cbf24392b 100644 --- a/vvp/vpi_mcd.cc +++ b/vvp/vpi_mcd.cc @@ -152,7 +152,15 @@ vpi_mcd_vprintf(PLI_UINT32 mcd, const char*fmt, va_list ap) mcd, fmt); } +#ifdef __MINGW32__ + /* + * The MinGW runtime (version 3.14) fixes some things, but breaks + * %f for us, so we have to us the underlying version. + */ + rc = _vsnprintf(buffer, sizeof buffer, fmt, ap); +#else rc = vsnprintf(buffer, sizeof buffer, fmt, ap); +#endif for(int i = 0; i < 31; i++) { if((mcd>>i) & 1) {