These versions of Visual Studio don't have stdint.h and all [u]intNN_t types. But now these types are everywhere in FLAC codebase. An easy fix would be to move definitions of these types from share/compat.h into FLAC/ordinals.h (see attached patch). But it may break some 3rd party programs that include (directly or indirectly) this file and also have their own typedefs for these types. (Also, currently FLAC/ordinals.h contains some nonsense like "typedef uint32_t __int32 FLAC__uint32;", but that's not a real problem) So, what to do? 1) include share/compat.h where needed (but it's too big, and even indirectly includes <windows.h>). 2) create a new file compat_stdint.h or compat_inttypes.h that has only necessary definitions and include it. 3) apply the attached patch and hope that it has the most compatible definitions for these types. 4) drop MSVC 2005/2008 support. 5) revert some changes of integer types to [u]intNN_t. -------------- next part -------------- A non-text attachment was scrubbed... Name: ordinals_fix.patch Type: application/octet-stream Size: 1738 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170117/7ab5fbaa/attachment.obj>
lvqcl wrote:> These versions of Visual Studio don't have stdint.h and > all [u]intNN_t types. But now these types are everywhere > in FLAC codebase.Here is the patch that fixes the problem: it moves definitions of all [u]intNN_t types from share/compat.h into new file share/msvc2005_int.h and then includes this file into all files (via "Force Includes" option in *.vcproj files). The definitions of these types are inside #if block with _MSC_VER < 1600 condition, so these changes affect only MS Visual Studio compilers with _MSC_VER < 1600 (i.e. MSVS 2005 and 2008). -------------- next part -------------- A non-text attachment was scrubbed... Name: msvc2005_integers.zip Type: application/zip Size: 3120 bytes Desc: not available URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20170118/744d413b/attachment.zip>
lvqcl wrote:> > These versions of Visual Studio don't have stdint.h and > > all [u]intNN_t types. But now these types are everywhere > > in FLAC codebase. > > Here is the patch that fixes the problem: > it moves definitions of all [u]intNN_t types from share/compat.h > into new file share/msvc2005_int.h and then includes this file > into all files (via "Force Includes" option in *.vcproj files). > > The definitions of these types are inside #if block with > _MSC_VER < 1600 condition, so these changes affect only MS Visual > Studio compilers with _MSC_VER < 1600 (i.e. MSVS 2005 and 2008).Thats a really great solution to this problem. Applied! Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/