[flac-dev] Bug fix and compatibility patches for 1.3.0pre4
JonY
10walls at gmail.com
Sat May 4 18:22:56 PDT 2013
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130505/e7754bf3/attachment.pgp
More information about the flac-dev
mailing list