[prev in list] [next in list] [prev in thread] [next in thread] 

List:       flac-dev
Subject:    Re: [Flac-dev] MinGW Patch
From:       "will surgent" <willeom () gmail ! com>
Date:       2008-08-13 15:50:42
Message-ID: c43b24a20808130850n608cf1f1i2ca2368d3261ed7 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@mega-nerd.com<mle%2Bla@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@xiph.org
> http://lists.xiph.org/mailman/listinfo/flac-dev
>

[Attachment #5 (text/html)]

<div dir="ltr"><span class="HcCDpe"><span class="JDpiNd">Thanks Erik!<br>Yep works \
fine on MinGW - much more elegant too!</span></span><br><br><div \
class="gmail_quote">On Wed, Aug 13, 2008 at 12:33 AM, Erik de Castro Lopo <span \
dir="ltr">&lt;<a href="mailto:mle%2Bla@mega-nerd.com">mle+la@mega-nerd.com</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">will \
surgent wrote:<br> <br>
&gt; Hello, I was trying to compile Flac on MinGW/Msys but got an error stating<br>
&gt; SIZE_T_MAX is undefined.<br>
&gt; To fix this error I edited the file &quot;flac-1.2.1/include/share/alloc.h&quot; \
and<br> &gt; made the following change:<br>
<br>
</div>&lt;snip&gt;<br>
<div class="Ih2E3d"><br>
&gt; #ifndef SIZE_MAX<br>
&gt; # ifndef SIZE_T_MAX<br>
&gt; # &nbsp;ifdef _MSC_VER<br>
&gt; # &nbsp; define SIZE_T_MAX UINT_MAX<br>
&gt; # &nbsp;elif defined(__MINGW_H)<br>
&gt; # &nbsp; define SIZE_T_MAX UINT_MAX<br>
&gt; # &nbsp;else<br>
&gt; # &nbsp; error<br>
&gt; # &nbsp;endif<br>
&gt; # endif<br>
&gt; # define SIZE_MAX SIZE_T_MAX<br>
&gt; #endif<br>
<br>
</div>Actually, there might be a better fix for this. How about:<br>
<br>
-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------<br>
                
--- include/share/alloc.h &nbsp; &nbsp; &nbsp; 2008-06-29 21:43:05.000000000 \
                +1000<br>
+++ include/share/alloc.h &nbsp; &nbsp; &nbsp; 2008-08-13 14:38:33.000000000 \
+1000<br> @@ -28,7 +28,7 @@<br>
 &nbsp;*/<br>
<br>
&nbsp;#include &lt;limits.h&gt; /* for SIZE_MAX */<br>
-#if !defined _MSC_VER &amp;&amp; !defined __MINGW32__ &amp;&amp; !defined \
__EMX__<br> +#if HAVE_STDINT_H<br>
&nbsp;#include &lt;stdint.h&gt; /* for SIZE_MAX in case limits.h didn&#39;t get it \
*/<br> &nbsp;#endif<br>
&nbsp;#include &lt;stdlib.h&gt; /* for size_t, malloc(), etc */<br>
-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------8&lt;-------<br>
 <br>
Does that work for MinGW?<br>
<div class="Ih2E3d"><br>
&gt; Hope I found the right place to submit this :~)<br>
<br>
</div>Yes.<br>
<br>
Erik<br>
--<br>
-----------------------------------------------------------------<br>
Erik de Castro Lopo<br>
-----------------------------------------------------------------<br>
`If you want a vision of the future, it is a wireless broadband<br>
&nbsp;network feeding requests for foreign money-laundering assistance<br>
&nbsp;into a human temporal lobe, forever. With banner ads.&#39;<br>
&nbsp;-- John M. Ford<br>
_______________________________________________<br>
Flac-dev mailing list<br>
<a href="mailto:Flac-dev@xiph.org">Flac-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/flac-dev" \
target="_blank">http://lists.xiph.org/mailman/listinfo/flac-dev</a><br> \
</blockquote></div><br></div>



_______________________________________________
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic