Hello, I was trying to compile Flac on MinGW/Msys but got an error stating SIZE_T_MAX is undefined. To fix this error I edited the file "flac-1.2.1/include/share/alloc.h" and made the following change: Starting at line #36 I changed: #ifndef SIZE_MAX # ifndef SIZE_T_MAX # ifdef _MSC_VER # define SIZE_T_MAX UINT_MAX # else # error # endif # endif # define SIZE_MAX SIZE_T_MAX #endif To: #ifndef SIZE_MAX # ifndef SIZE_T_MAX # ifdef _MSC_VER # define SIZE_T_MAX UINT_MAX # elif defined(__MINGW_H) # define SIZE_T_MAX UINT_MAX # else # error # endif # endif # define SIZE_MAX SIZE_T_MAX #endif Hope I found the right place to submit this :~) --Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20080813/deec00df/attachment.htm
will surgent wrote:> Hello, I was trying to compile Flac on MinGW/Msys but got an error stating > SIZE_T_MAX is undefined. > To fix this error I edited the file "flac-1.2.1/include/share/alloc.h" and > made the following change:<snip>> #ifndef SIZE_MAX > # ifndef SIZE_T_MAX > # ifdef _MSC_VER > # define SIZE_T_MAX UINT_MAX > # elif defined(__MINGW_H) > # define SIZE_T_MAX UINT_MAX > # else > # error > # endif > # endif > # define SIZE_MAX SIZE_T_MAX > #endifActually, there might be a better fix for this. How about: -------8<-------8<-------8<-------8<-------8<-------8<-------8<------- --- include/share/alloc.h 2008-06-29 21:43:05.000000000 +1000 +++ include/share/alloc.h 2008-08-13 14:38:33.000000000 +1000 @@ -28,7 +28,7 @@ */ #include <limits.h> /* for SIZE_MAX */ -#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ +#if HAVE_STDINT_H #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ #endif #include <stdlib.h> /* for size_t, malloc(), etc */ -------8<-------8<-------8<-------8<-------8<-------8<-------8<------- Does that work for MinGW?> Hope I found the right place to submit this :~)Yes. Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- `If you want a vision of the future, it is a wireless broadband network feeding requests for foreign money-laundering assistance into a human temporal lobe, forever. With banner ads.' -- John M. Ford
Hello, On Wed, Aug 13, 2008 at 12:23:18AM -0400, will surgent wrote :> Hello, I was trying to compile Flac on MinGW/Msys but got an error stating > SIZE_T_MAX is undefined.We have the same issue here.> To fix this error I edited the file "flac-1.2.1/include/share/alloc.h" and > made the following change: > > Starting at line #36 I changed: > > #ifndef SIZE_MAX > # ifndef SIZE_T_MAX > # ifdef _MSC_VER > # define SIZE_T_MAX UINT_MAX > # else > # error > # endif > # endif > # define SIZE_MAX SIZE_T_MAX > #endif > > To: > > #ifndef SIZE_MAX > # ifndef SIZE_T_MAX > # ifdef _MSC_VER > # define SIZE_T_MAX UINT_MAX > # elif defined(__MINGW_H) > # define SIZE_T_MAX UINT_MAX > # else > # error > # endif > # endif > # define SIZE_MAX SIZE_T_MAX > #endifI however use a different fix: diff -ur flac-1.2.1/include/share/alloc.h flac/include/share/alloc.h --- flac-1.2.1/include/share/alloc.h>---2007-09-12 06:32:21.000000000 +0100 +++ flac/include/share/alloc.h>-2007-09-25 20:54:09.000000000 +0100 @@ -28,7 +28,7 @@ */ - #include <limits.h> /* for SIZE_MAX */ -#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ +#if !defined _MSC_VER && !defined __EMX__ #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ #endif #include <stdlib.h> /* for size_t, malloc(), etc */ Best regards, -- Jean-Baptiste Kempf http://www.jbkempf.com/
Thanks Erik! Yep works fine on MinGW - much more elegant too! On Wed, Aug 13, 2008 at 12:33 AM, Erik de Castro Lopo <mle+la at mega-nerd.com<mle%2Bla at mega-nerd.com>> wrote:> will surgent wrote: > > > Hello, I was trying to compile Flac on MinGW/Msys but got an error > stating > > SIZE_T_MAX is undefined. > > To fix this error I edited the file "flac-1.2.1/include/share/alloc.h" > and > > made the following change: > > <snip> > > > #ifndef SIZE_MAX > > # ifndef SIZE_T_MAX > > # ifdef _MSC_VER > > # define SIZE_T_MAX UINT_MAX > > # elif defined(__MINGW_H) > > # define SIZE_T_MAX UINT_MAX > > # else > > # error > > # endif > > # endif > > # define SIZE_MAX SIZE_T_MAX > > #endif > > Actually, there might be a better fix for this. How about: > > -------8<-------8<-------8<-------8<-------8<-------8<-------8<------- > --- include/share/alloc.h 2008-06-29 21:43:05.000000000 +1000 > +++ include/share/alloc.h 2008-08-13 14:38:33.000000000 +1000 > @@ -28,7 +28,7 @@ > */ > > #include <limits.h> /* for SIZE_MAX */ > -#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ > +#if HAVE_STDINT_H > #include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */ > #endif > #include <stdlib.h> /* for size_t, malloc(), etc */ > -------8<-------8<-------8<-------8<-------8<-------8<-------8<------- > > Does that work for MinGW? > > > Hope I found the right place to submit this :~) > > Yes. > > Erik > -- > ----------------------------------------------------------------- > Erik de Castro Lopo > ----------------------------------------------------------------- > `If you want a vision of the future, it is a wireless broadband > network feeding requests for foreign money-laundering assistance > into a human temporal lobe, forever. With banner ads.' > -- John M. Ford > _______________________________________________ > Flac-dev mailing list > Flac-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/flac-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20080813/00dfdb3e/attachment.htm
Erik de Castro Lopo wrote:> will surgent wrote: > > > Hello, I was trying to compile Flac on MinGW/Msys but got an error stating > > SIZE_T_MAX is undefined. > > To fix this error I edited the file "flac-1.2.1/include/share/alloc.h" and > > made the following change:Would it be possible to get this patch applied? I still hit this every time I try to compile with MinGW. Cheers, Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- Traditional capital was stuck in a company's bank account or investments. It could not walk away in disgust. Human capital has free will. It can walk out the door; traditional capital cannot.