Menu

#231 FAAD2 v2.8.6 - Win32 Build Fix

None
closed-accepted
nobody
None
5
2017-12-17
2017-12-16
MuldeR
No

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.

  1. 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.

  2. 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.

  3. 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

1 Attachments

Discussion

  • Krzysztof Nikiel

    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.

     
    • MuldeR

      MuldeR - 2017-12-16

      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 the configure.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.h

       

      Last edit: MuldeR 2017-12-16
  • Krzysztof Nikiel

    Yes, if you could run a script from VC it would solve it.

     
    • MuldeR

      MuldeR - 2017-12-16

      This is possible, indeed.

      Only complicated by the lack of grep and friends in the windows command shell.

       

      Last edit: MuldeR 2017-12-16
      • Krzysztof Nikiel

        As a last resort you can write some simple C code, compile it and use the executable to extract version string from configure.ac

         
        • MuldeR

          MuldeR - 2017-12-17

          Done!

          Please have a look here:
          https://github.com/knik0/faad2/pull/5

          Best Regards,
          MuldeR

           
  • Krzysztof Nikiel

    • status: open --> closed-accepted
    • Group: -->
     

Log in to post a comment.