On 3/17/2013 18:37, Erik de Castro Lopo wrote: > JonY wrote: > >> On 3/17/2013 10:33, Janne Hyvärinen wrote: >>> Here's a patch that makes MSVC compiled flac.exe able to use wildcards >>> and encode/decode files with Unicode characters in names. It may not be >>> the prettiest code but it fulfills its primary purpose. >>> I tried to alter FLAC code as little as possible. It replaces argv with >>> utf-8 encoded version and only converts to usable Unicode for file >>> functions. That means printed texts and tags that contain non-ascii >>> characters will be broken, but it is fixable if these changes are >>> acceptable. >>> >> >> Can this be reworked without the defines? This way, it should support >> mingw builds too. > > +1 > > I'd like to see some way to do this to: > > a) Make this usable from MinGW compiled binaries. > b) Reduce the the amount of inline #ifdef hackery. >
A simple way to do this is to make all C IO calls that need OS specific hacks go into the compatibility module. Eg for open() calls: int _flac_open(....){ #if win32 ... #else if os2 ... #else ... [generic call to open() without hacks] #endif } All those ifdefs will at least be confined rather than spread out through the code.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev