[Flac-dev] MinGW Patch

will surgent willeom at gmail.com
Wed Aug 13 08:50:42 PDT 2008


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 


More information about the Flac-dev mailing list