Hello.
I'm tyring to build FAAD2 v2.8.6 on Win32, using VC 2017 (MSVC 15.5) and I'm running into a few problems.
The project/solution files for MSVC are missing from the release ZIP (source code) file. Had to fetch them from GIT directly. Not really a big deal, but it might confuse some people.
In "mp4read.c" the functions bswap32() and bswap16() use GCC-specific functions __builtin_bswap32
and __builtin_bswap16
that don't exist in MSVC! Instead we have to use _byteswap_ulong
and _byteswap_ushort
here when building with MSVC.
In "decoder.c" the undefined constant PACKAGE_VERSION
. I don't know what is the best way to fix this, as I suppose this will be defined via -DPACKAGE_VERSION=FOO
in the CFLAGS when building with GCC and Make. Probably should be defined in the MSVC project file, in the "pre-processor" section. But where to get the proper version from?
Please see fixes attached!
Best Regards,
MuldeR
Apparenty you fixed a real bug in bswap functions. Thanks!
The version is defined in configure.ac: "AC_INIT(faad2, 2.8.6)" but I have no idea how to transfer it to MSVC.
I noticed there is a file calld
win32_ver.h
referenced in the VC project file. But that file does not actually exist. And, apparently, it is not#include
'd anywhere.Guess we need to:
1. Add a batch script that will generate
win32_ver.h
from theconfigure.ac
2. Add that batch script as a pre-built action to the VC project
3. Change
decoder.c
so that, on Win32, it#include
's the win32_ver.hLast edit: MuldeR 2017-12-16
Yes, if you could run a script from VC it would solve it.
This is possible, indeed.
Only complicated by the lack of
grep
and friends in the windows command shell.Last edit: MuldeR 2017-12-16
As a last resort you can write some simple C code, compile it and use the executable to extract version string from configure.ac
Done!
Please have a look here:
https://github.com/knik0/faad2/pull/5
Best Regards,
MuldeR