From 11d7cbd3e20965414705b4e5970b26b265219048 Mon Sep 17 00:00:00 2001 From: "Frederick C. Kurz" Date: Fri, 10 Jul 2015 12:50:39 -0400 Subject: [PATCH] Changes to vpi/sys_fileio.c Changed for "Microsoft Visual Studio Express 2015 RC Web" so running vvp on pr2800985a.v won't crash. --- vpi/sys_fileio.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vpi/sys_fileio.c b/vpi/sys_fileio.c index ec99c9f00..f63fd64e0 100644 --- a/vpi/sys_fileio.c +++ b/vpi/sys_fileio.c @@ -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;