[Flac-dev] MinGW Patch

Jean-Baptiste Kempf jb at videolan.org
Tue Aug 12 21:33:52 PDT 2008


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
> #endif

I 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/


More information about the Flac-dev mailing list