On 11/10/2011 18:39, Erik de Castro Lopo wrote:> > I'm subscribed to the list (and I set my reply-to to the list). > Please do not CC me. > > JonY wrote: > >> Its probably on one of the sf tracker somewhere, I can't seem to find it >> anymore. It wasn't anything complicated, so I should be able to redo it >> quickly. > > I'm a Linux guy. I do not have easy access to a windows machine > and don't have the time or patience to maintain one. > > For windows stuff I'll be relying on others to provide and test > patches. > > ErikAlright, here's a quick fix, although it is more ugly than I remembered. Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h where available, and falls back to I64 on MSVC and then ll for others, all format warnings suppressed. Tested on MinGW. Sven-Hendrik, or any other mingw guys around, do you mind testing the patch too? Patch based on git master from https://git.xiph.org/mirrors/flac.git. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: printf_quick_fix.txt Url: http://lists.xiph.org/pipermail/flac-dev/attachments/20111110/5507cb23/attachment-0001.txt -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20111110/5507cb23/attachment-0001.pgp
On 11/10/2011 19:22, JonY wrote:> On 11/10/2011 18:39, Erik de Castro Lopo wrote: >> >> I'm subscribed to the list (and I set my reply-to to the list). >> Please do not CC me. >> >> JonY wrote: >> >>> Its probably on one of the sf tracker somewhere, I can't seem to find it >>> anymore. It wasn't anything complicated, so I should be able to redo it >>> quickly. >> >> I'm a Linux guy. I do not have easy access to a windows machine >> and don't have the time or patience to maintain one. >> >> For windows stuff I'll be relying on others to provide and test >> patches. >> >> Erik > > Alright, here's a quick fix, although it is more ugly than I remembered. > > Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h > where available, and falls back to I64 on MSVC and then ll for others, > all format warnings suppressed. > > Tested on MinGW. > > Sven-Hendrik, or any other mingw guys around, do you mind testing the > patch too? Patch based on git master from > https://git.xiph.org/mirrors/flac.git. >Ifdef changes now consolidated into a single file. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: printf_quick_fix.txt Url: http://lists.xiph.org/pipermail/flac-dev/attachments/20111114/630c3b01/attachment.txt -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20111114/630c3b01/attachment.pgp
On 11/14/2011 18:01, JonY wrote:> On 11/10/2011 19:22, JonY wrote: >> On 11/10/2011 18:39, Erik de Castro Lopo wrote: >>> >>> I'm subscribed to the list (and I set my reply-to to the list). >>> Please do not CC me. >>> >>> JonY wrote: >>> >>>> Its probably on one of the sf tracker somewhere, I can't seem to find it >>>> anymore. It wasn't anything complicated, so I should be able to redo it >>>> quickly. >>> >>> I'm a Linux guy. I do not have easy access to a windows machine >>> and don't have the time or patience to maintain one. >>> >>> For windows stuff I'll be relying on others to provide and test >>> patches. >>> >>> Erik >> >> Alright, here's a quick fix, although it is more ugly than I remembered. >> >> Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h >> where available, and falls back to I64 on MSVC and then ll for others, >> all format warnings suppressed. >> >> Tested on MinGW. >> >> Sven-Hendrik, or any other mingw guys around, do you mind testing the >> patch too? Patch based on git master from >> https://git.xiph.org/mirrors/flac.git. >> > > Ifdef changes now consolidated into a single file.Ping, no comments? I noticed some more ifdeferies around that needs consolidating and warnings that need suppressing, that can go into a separate patch. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20111115/20c16d81/attachment.pgp
Erik de Castro Lopo
2012-Feb-01 10:52 UTC
[flac-dev] [Flac-dev] Git branch with compiling fixes for win32
JonY wrote:> Alright, here's a quick fix, although it is more ugly than I remembered. > > Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h > where available, and falls back to I64 on MSVC and then ll for others, > all format warnings suppressed.JonY, Sorry for the delay on actually getting on to this. I tried your patch, but it wasn't quite right. The problem is that %ll is the correct format specifier for uint64_t on 32bit Linux but not on 64 bit Linux. In C99, the correct way to print a uint64_t value is: printf ("THe value is : " PRIu64 "\n", value) ; I have gone ahead and fixed this through the code and fixed this, but I may have broken some either MSVC or MinGW on the way. I'd appreciate it if you test whats in git now. For those files where any compiler baulks at the PRIu64/PRIx64/PRId64, you should add a #ifdef block that might look something like: #ifdef HAVE_INTTYPES_H #include <inttypes.h> #else #if defined (_MSC_VER) && ! defined (PRId64) #define PRId64 "I64d" #endif #if defined (_MSC_VER) && ! defined (PRIu64) #define PRIu64 "I64u" #endif #endif We'll worry about compilers that don't have the PRI_64 values as we find them. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01.02.2012 14:52, Erik de Castro Lopo wrote:> In C99, the correct way to print a uint64_t value is: >Is it wise to aim at C99? While i have absolutely nothing against it, it is a known fact that MS never got around to support C99 in MSVC to any considerable degree. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJPKRznAAoJEOs4Jb6SI2CwdUMIAI0qXyQ3m4bTrBoqJL77mP+Z 8y+nRTstCFMtx5YQ/Ym4N4fbD5xxKBdOIcDXWenlXwZJnGTLPvXuljIWJS3+a05F BWj6ybhDYMuJ9rDzkSRtYd4dxxeWC2A2O6QD5MsvklvWmhBHlECDBEDr8vIJItfk ZxHkEjdJOIMuufCeuMTPuTquFhYbm6eCbZsOFlbrqWAyxAyeWlkoQ/7SqsWOrKz7 jrb8HHIoh3C1DjJIAVKE68BvXFE6z4uNx9u530oD2mzCgO0BoGpBU47OLy0L4ETv vSNiCs9HoMRAvrAL+jtAuHUMOvw4yXFwgIxN3fL/jxx1BrsBnC2yEjki/nN1ArY=H4h+ -----END PGP SIGNATURE-----
JonY
2012-Feb-01 14:36 UTC
[flac-dev] [Flac-dev] Git branch with compiling fixes for win32
On 2/1/2012 18:52, Erik de Castro Lopo wrote:> JonY wrote: > >> Alright, here's a quick fix, although it is more ugly than I remembered. >> >> Basically, it removes those _MSC_VER ifdefs, and relies on inttypes.h >> where available, and falls back to I64 on MSVC and then ll for others, >> all format warnings suppressed. > > JonY, > > Sorry for the delay on actually getting on to this. > > I tried your patch, but it wasn't quite right. The problem is that %ll > is the correct format specifier for uint64_t on 32bit Linux but not > on 64 bit Linux. >Something is very very wrong about the above statements. I thought I used PRI?64 when inttypes.h is found (Linux should have it, old code uses %ll? anyway for non-msvc, so shouldn't have any new issues). inttypes.h and stdint.h is supposed to be abstractions to remove these issues.> In C99, the correct way to print a uint64_t value is: > > printf ("THe value is : " PRIu64 "\n", value) ; > > I have gone ahead and fixed this through the code and fixed this, but I > may have broken some either MSVC or MinGW on the way. I'd appreciate it > if you test whats in git now. > > For those files where any compiler baulks at the PRIu64/PRIx64/PRId64, > you should add a #ifdef block that might look something like: > > #ifdef HAVE_INTTYPES_H > #include <inttypes.h> > #else > #if defined (_MSC_VER) && ! defined (PRId64) > #define PRId64 "I64d" > #endif > #if defined (_MSC_VER) && ! defined (PRIu64) > #define PRIu64 "I64u" > #endif > #endif > > We'll worry about compilers that don't have the PRI_64 values as we find > them. >OK, I'll do a quick test build tomorrow. More thorough testing will come during the weekends. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 196 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20120201/f869625c/attachment.pgp