On 5/5/2013 09:03, Timothy B. Terriberry wrote: > Robert Kausch wrote: >> The _lseeki64 patch probably is a little more controversial. The problem >> is that fseeki64 and ftelli64 are not available in Windows XP - at least >> not without installing extra MSVC runtime libraries. I changed compat.h >> and replaced them with calls to _lseeki64, which was available at least >> back to Windows 98 and thus doesn't impose such compatibility issues. > > _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. >
How about just forgetting about base XP and require at least SP2 or some such? Alternatively, use win32api underneath instead, eg CreateFileW/SetFilePointer. > 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? If not, they get called by fsetpos()/fgetpos() (which _do_ > interact correctly with the buffering in stdio streams), except when > _MAC is defined (which I presume is not common). I don't actually have > XP to test against. Bad, do no declare manually, I had to cleanup some bad code recently that make assumptions about your header declarations. You can try using GetModuleHandle/GetProcAddress instead, but msvcr* versions are a whole different can of worms.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev