[flac-dev] Patch to add Unicode filename support for win32 flac
JonY
10walls at gmail.com
Mon Mar 18 02:28:58 PDT 2013
On 3/18/2013 09:55, LRN wrote:
> On 18.03.2013 02:10, JonY wrote:
>> On 3/17/2013 23:01, LRN wrote:
>>>> All those ifdefs will at least be confined rather than spread
>>>> out through the code.
>>> I did it plibc-style:
>>>
>>> in compat.h: #if defined(_WIN32) #define FOPEN
>>> grabbag__fopen_utf8_wrapper #else #define FOPEN fopen #endif
>>>
>>> in grabbag: #if defined(_WIN32) <implement
>>> grabbag__fopen_utf8_wrapper, which has the same signature as
>>> fopen, but does utf8->utf16 conversion internally, then calls
>>> wfopen> #endif
>>>
>>> and replace "fopen" with "FOPEN" everywhere else.
>
>> Don't do that, it leaks into the system headers
> How? compat.h is not a public header, it is only used internally in
> FLAC. And i don't think that system headers have defines for "FOPEN"
> and such.
>
Preprocessor macros are not scoped. Even if FOPEN may not, but future
compat code that follow this pattern might easily bump into unrelated
identifiers. utime_uft8 already did some amount of damage.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130318/fd5c585d/attachment.pgp
More information about the flac-dev
mailing list