X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fwin32%2Ffunctions%2F_PDCLIB%2F_PDCLIB_seek.c;h=6bf53e9809780562e136cd94f83b5dcfe28c54cc;hb=48b352165d2cb89126ddde1323a138820687970a;hp=3add6591c535962fc775a9a311759bcb0b64f8de;hpb=04ff9a4a124eaa87d5d26d90077fb4ed15f3277f;p=pdclib diff --git a/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c b/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c index 3add659..6bf53e9 100644 --- a/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c +++ b/platform/win32/functions/_PDCLIB/_PDCLIB_seek.c @@ -12,6 +12,12 @@ #include <_PDCLIB_glue.h> #include +#if _PDCLIB_C_MIN(2011) +_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"); +#endif + extern void _PDCLIB_w32errno( void ); _PDCLIB_int64_t _PDCLIB_seek( struct _PDCLIB_file_t * stream, _PDCLIB_int64_t offset, int whence ) { @@ -22,6 +28,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; }