src/libFLAC/memory.c cannot be compiled with MSVS 2005 (and probably VS2008 too) after this commit: http://git.xiph.org/?p=flac.git;a=commitdiff;h=7cbecbae9f70be770f7651d09531fec0de6f9cf5 because MSVS2005 doesn't provide stdint.h. According to MSDN, uintptr_t is defined in "STDDEF.H and other include files".
lvqcl wrote:> src/libFLAC/memory.c cannot be compiled with MSVS 2005 (and > probably VS2008 too) after this commit: > > http://git.xiph.org/?p=flac.git;a=commitdiff;h=7cbecbae9f70be770f7651d09531fec0de6f9cf5 > > because MSVS2005 doesn't provide stdint.h. According to MSDN, > uintptr_t is defined in "STDDEF.H and other include files".Does the rest of FLAC actually support those compilers? Is it worth continuing to support them? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Erik de Castro Lopo wrote:>> because MSVS2005 doesn't provide stdint.h. According to MSDN, >> uintptr_t is defined in "STDDEF.H and other include files". > > Does the rest of FLAC actually support those compilers?Yes. I removed this #include and all projects were successfully built with MSVS 2005 Express.> Is it worth > continuing to support them?* At least Audacity team still uses VS 2008: http://wiki.audacityteam.org/wiki/Developing_On_Windows * Also the latest version of Winamp was built with VS 2008. But then Winamp was sold to Radionomy, so who knows what tools they use now... -------------- Why MSVS can compile memory.c when "#include <stdint.h>" was removed: memory.c includes "private/memory.h", it indirectly includes <crtdefs.h> where uintptr_t is defined. But it's implementation details... -------------- memory.c also includes "share/alloc.h" which contains the following code: #if HAVE_STDINT_H #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ #endif but memory.c includes <stdint.h> unconditionally. What was the reason for this #ifdef/#endif? Compatibility with non-C99 compilers? -------------- Maybe the simplest fix for this problem is to replace #include <stdint.h> with #ifdef HAVE_STDINT_H #include <stdint.h> #else #include <stddef.h> #endif or #ifndef _MSC_VER #include <stdint.h> #else #include <stddef.h> #endif
That's odd. I just tried, but I'm not having any trouble building FLAC on MSVC 2005. Could it be stdint.h is provided by a platform SDK? In that case, this doesn't really break compatibility, I remember a platform SDK was necessary to build FLAC with MSVC 2005 anyway. op 03-05-14 19:46, lvqcl schreef:> src/libFLAC/memory.c cannot be compiled with MSVS 2005 (and > probably VS2008 too) after this commit: > > http://git.xiph.org/?p=flac.git;a=commitdiff;h=7cbecbae9f70be770f7651d09531fec0de6f9cf5 > > because MSVS2005 doesn't provide stdint.h. According to MSDN, > uintptr_t is defined in "STDDEF.H and other include files". > _______________________________________________ > flac-dev mailing list > flac-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/flac-dev
Martijn van Beurden wrote:> That's odd. I just tried, but I'm not having any trouble > building FLAC on MSVC 2005. Could it be stdint.h is provided by > a platform SDK?I have "Windows Server 2003 SP1 Platform SDK" installed: http://www.microsoft.com/en-us/download/details.aspx?id=15656 "Date Published: 5/2/2005", so it's about as old as MSVS 2005. It doesn't contain stdint.h. Or at least I can't find it anywhere... I suspect that you have newer "Windows SDK for Windows 7 and .NET Framework 4": http://www.microsoft.com/en-us/download/details.aspx?id=8442> In that case, this doesn't really break compatibility, I > remember a platform SDK was necessary to build FLAC with MSVC > 2005 anyway.AFAIK Platform SDK is only necessary for MSVS 2005/2008/2010 Express Edition; Pro/Premium/Ultimate editions didn't require it so far.