WIN9X: Bring FLAC support back, through FLAC 1.2.1 (with patches) #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's some work to bring FLAC support back to the Win9x builds.
Current status
We have some users missing FLAC support, for this port:
(e.g. games with Redbook audio, and where the tracks haven't been converted to Ogg Vorbis or MP3. Win9x builds are currently recommended to Windows XP users as well, so this also applies to them.)
It was disabled, because current FLAC releases expect
_stat64(and similar constucts) to be there, but they "weren't added toMSVCRT.DLLuntil later versions of Windows" (quoting @ccawley2011's comment above). So building it would fail.I spent some time trying to have mingw2 present some fake 64-bit APIs as shortcuts to the 32-bit ones (that should be good enough for our FLAC usage), to no avail. Removing the (intentionally) hardcoded "bigfile" support from FLAC also felt quite hard.
What this PR does
So I thought about reverting to the last FLAC release which used the old 32-bit APIs on Windows. This PR then adds an exception to the
windows-9xtoolchain, reusing some work from the old opendingux toolchain, and also reusing the Win95 patch that's been written for SDL1.2.I had to patch some other stuff, e.g. for better compatibility with newer compilers, and I backported some v1.3.x upstream commits to improve the NASM code targeted at older processors (it's a Win95/Win98 build after all, so I guess supporting old processors and giving them some speed-up could help).
By the way, FLAC 1.3 then forced SSE2 support by default, removed 3DNow support, things like that. (Although we just use the decoder, not the encoder, and only the latter seems to use the more complicated asm code.)
Oh, and if you worry about using a 2007 library, don't forget that this is for users wanting to run ScummVM on a 1995 OS 😁
Tests
I've built the new toolchain, and did a 2.10.0git test build with it. It appears to work just fine.
But I just very, very rarely use this port, so I've asked of of the Win 9x users to test this change and report any problem.
(And as usual I can't make it short, eh!)