X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_seek.c;h=e23cd3cbaf5af4ac71910663085487ca0f9d0fa7;hb=9e4097fc475d29a1f43c1c3885d774bd11c08ca9;hp=3add6591c535962fc775a9a311759bcb0b64f8de;hpb=4808a96c310b742c21fcc3b41663b4071536f185;p=pdclib.old diff --git a/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c b/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c index 3add659..e23cd3c 100644 --- a/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c +++ b/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c @@ -12,6 +12,10 @@ #include <_PDCLIB_glue.h> #include +_Static_assert(SEEK_SET == FILE_BEGIN, "SEEK_SET is incorrect"); +_Static_assert(SEEK_CUR == FILE_CURRENT, "SEEK_CUR is incorrect"); +_Static_assert(SEEK_END == FILE_END, "SEEK_END is incorrect"); + extern void _PDCLIB_w32errno( void ); _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t offset, int whence ) { @@ -22,6 +26,10 @@ _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t of _PDCLIB_w32errno(); return EOF; } + + stream->ungetidx = 0; + stream->bufidx = 0; + stream->bufend = 0; stream->pos.offset = liOffset.QuadPart; return liOffset.QuadPart; }