Ben Allison wrote:> >> * change instances of uint32_t in bitwriter.c to FLAC__uint32 > > > > Can we include <inttypes.h> to fix this instead? > > Sadly there is no inttypes.h on MSVC. At least versions to Visual Studio > 2010. I presume this is why ordinal.h was created in the first place.I'm not sure how Josh came to do it that way. In general, I prefer not to create a bunch of types that overload what should be standard types. For this release I would not change any type that appears as FLAC_whatever in the public API, but for types defined internally I would prefer to stick with the standard C99 types. Maybe something like this: http://stackoverflow.com/posts/127166/revisions from the SO question: http://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio Will help.> I'll use the compat.h header for the __inline fix and move the function > definitions to the header file and redo the patch.Thanks! YOu may also want to add the stdint.h style typedefs to that same file. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Here's another go at it. I only have VS2008 and VS2010 to test with right now. VS6.0, VS2003 and VS2005 are untested. I'm still not too happy with it, but it does work. I would recommend using FLAC__uint32 instead of uint32_t to avoid these small #if _MSC_VER < xxxx things everywhere, although I completely understand the desire to use C99 types. I've only done libFLAC, because I'm not as familiar with the rest of the codebase. But I will make another pass today with the other library and binaries.> Thanks! YOu may also want to add the stdint.h style typedefs to that same > file.-------------- next part -------------- A non-text attachment was scrubbed... Name: flac-1-3-0-MSVC.patch Type: application/octet-stream Size: 5531 bytes Desc: not available Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130304/366053e7/attachment.obj
Ben Allison wrote:> Here's another go at it. I only have VS2008 and VS2010 to test with right > now. VS6.0, VS2003 and VS2005 are untested.Thanks for your work on this Ben.> I would recommend using FLAC__uint32 instead of uint32_t to avoid these > small #if _MSC_VER < xxxx things everywhere, although I completely > understand the desire to use C99 types.If we add _MSC_VER guarded definitions of the C99 type we need to include/share/compat.h then we should need the little #ifdefs everywhere. My general rules for this is: a) If its in the public header file don't mess with it too much (your MSVC changes to use __intXX are fine). b) If its code internal to the library use C99 type is possible. c) If its internal to the library and i needs tweaking for a particular compiler, add it to include/share/compat.h and include that header where needed.> I've only done libFLAC, because I'm not as familiar with the rest of the > codebase. But I will make another pass today with the other library and > binaries.Great, thanks! Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/