[flac-dev] Bug fix and compatibility patches for 1.3.0pre4

Robert Kausch robert.kausch at freac.org
Sun May 5 16:20:52 PDT 2013


Timothy B. Terriberry wrote:
> _lseeki64 operates on the underlying file handle, and does not interact
> well with the buffering in stdio streams. I _think_ you can use this
> successfully if you call fflush() beforehand (as this sets FILE::_cnt to
> 0 and FILE::_ptr to FILE::_base). By which I mean I read the MSVCRT
> source from MSVC6.0 and it appears this is how things work.
Ok, I didn't take that into account. Thanks for pointing it out! Using 
fflush to clear the buffers before calling _lseeki64 sounds reasonable, 
so I think I'll try that.

I noticed another problem with _lseeki64 though. It returns the new file 
pointer position on success instead of 0, so the macro will have to take 
that into account.
> That source also includes an fseeki64()/ftelli64(), but they are not
> defined in stdio.h. I wonder if just declaring it yourself is good
> enough?
Those functions are not exported by XPs msvcrt.dll, so declaring them 
won't help.


More information about the flac-dev mailing list