Ben Wilhelm <zorba-libf...@pavlovian.net> wrote:

I've been putting some work into building Libflac into a game engine I'm 
working on. I ran into a few small issues in the process, and was able to fix 
them, so I thought I'd post with my fixes. These aren't generally applicable - 
I'm taking a "shortest path to functionality" approach - but with a little work 
could probably be turned into general patches. First, I'm occasionally building 
under MingW, via the Windows headers. LibFlac makes use of a constant 
SIZE_T_MAX, which, under MSVC, is defined as UINT_MAX. Unfortunately MSVC isn't 
the determining factor here, the Windows headers are, and so MingW results in 
an error. My simple fix was to remove the MSVC check - if SIZE_T_MAX doesn't 
exist, it *always* defines it as UINT_MAX. That's line 38 in 
include/share/alloc.h. Second, I'm occasionally building under OSX. I ran into 
a bunch of problems with OSX thanks to its weird 32bit/64bit setup, but I don't 
currently care about 64bit so I just did what was necessary to force it to 
 32bit.
The final issue ended up being the assembly routines, which don't understand 
OSX's "macho" format. In src/libFLAC/ia32/nasm.h, I replaced "%error 
unsupported object format!" with "%define FLAC__PUBLIC_NEEDS_UNDERSCORE" and 
everything worked beautifully. Obviously in a real situation you'd want to 
create an %elifdef OBJ_FORMAT_macho block. Unless I've completely botched my 
test program, which is always possible, both builds now work flawlessly. Hope 
this helps someone :) -Ben_____________________________________________
Flac-dev mailing list Flac-dev@xiph.org 
http://lists.xiph.org/mailman/listinfo/flac-dev 


See here: http://www.schleef.org/blog/2011/02/03/flac-code-mirror/

I use the patch branch in there to cross compile my game engine which 
indirectly uses libflac.
-- Sven-Hendrik
_______________________________________________
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to