Changes to vvp/vpi_mcd.cc

Changed for"Microsoft Visual Studio Express 2015 RC Web" so vpi/pr723.v would pass.
This commit is contained in:
Frederick C. Kurz 2015-07-10 12:50:40 -04:00 committed by Stephen Williams
parent 4cf4cdabcd
commit a3728dcf20
1 changed files with 15 additions and 1 deletions

View File

@ -161,7 +161,14 @@ extern "C" PLI_UINT32 vpi_mcd_open(char *name)
return 0; /* too many open mcd's */
got_entry:
#if defined(__GNUC__)
mcd_table[i].fp = fopen(name, "w");
#else
if (strcmp(name, "/dev/null") != 0)
mcd_table[i].fp = fopen(name, "w");
else
mcd_table[i].fp = fopen("nul", "w");
#endif
if(mcd_table[i].fp == NULL)
return 0;
mcd_table[i].filename = strdup(name);
@ -298,7 +305,14 @@ extern "C" PLI_INT32 vpi_fopen(const char*name, const char*mode)
}
got_entry:
fd_table[i].fp = fopen(name, mode);
#ifndef _MSC_VER
fd_table[i].fp = fopen(name, mode);
#else // Changed for MSVC++ so vpi/pr723.v will pass.
if(strcmp(name, "/dev/null") != 0)
fd_table[i].fp = fopen(name, mode);
else
fd_table[i].fp = fopen("nul", mode);
#endif
if (fd_table[i].fp == NULL) return 0;
fd_table[i].filename = strdup(name);
return ((1U<<31)|i);