Changes to vpi/sys_fileio.c

Changed for "Microsoft Visual Studio Express 2015 RC Web" so running vvp on pr2800985a.v won't crash.
This commit is contained in:
Frederick C. Kurz 2015-07-10 12:50:39 -04:00 committed by Stephen Williams
parent 7aff1adf99
commit 11d7cbd3e2
1 changed files with 9 additions and 0 deletions

View File

@ -880,7 +880,16 @@ static PLI_INT32 sys_fseek_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
}
val.format = vpiIntVal;
#if defined(__GNUC__)
val.value.integer = fseek(fp, offset, oper);
#else
if(oper < 0) {
val.value.integer = EOF;
errno = EINVAL;
}
else
val.value.integer = fseek(fp, offset, oper);
#endif
vpi_put_value(callh, &val, 0 , vpiNoDelay);
return 0;