From: nu774 Date: Sun, 3 Feb 2013 03:11:13 +0000 (+0900) Subject: win32: change _wfopen() -> wfsopen() X-Git-Tag: v0.1.6~1 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=7ce09815f76d9b3d454719458c119c189fc6711c;p=fdkaac.git win32: change _wfopen() -> wfsopen() --- diff --git a/src/compat_win32.c b/src/compat_win32.c index 23edd91..d65ea50 100644 --- a/src/compat_win32.c +++ b/src/compat_win32.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "compat.h" #define WIN32_LEAN_AND_MEAN @@ -66,9 +67,12 @@ FILE *aacenc_fopen(const char *name, const char *mode) fp = (mode[0] == 'r') ? stdin : stdout; _setmode(_fileno(fp), _O_BINARY); } else { + int share = _SH_DENYRW; + if (strchr(mode, 'r') && !strchr(mode, '+')) + share = _SH_DENYWR; codepage_decode_wchar(CP_UTF8, name, &wname); codepage_decode_wchar(CP_UTF8, mode, &wmode); - fp = _wfopen(wname, wmode); + fp = _wfsopen(wname, wmode, share); free(wname); free(wmode); }