diff options
author | Chris Robinson <[email protected]> | 2018-11-10 04:27:10 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-10 04:27:10 -0800 |
commit | dc31969b04395db71d8162587f55cf81e7e69aac (patch) | |
tree | 7c4d07e655dc4fb4f6b19b477207b196799ce649 /Alc/ALc.c | |
parent | 58eb0e754d19237ca66d705834081a236e307484 (diff) |
Get rid of the last few al_fopen calls
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -918,7 +918,22 @@ static void alc_initconfig(void) str = getenv("ALSOFT_LOGFILE"); if(str && str[0]) { - FILE *logfile = al_fopen(str, "wt"); +#ifdef _WIN32 + FILE *logfile = NULL; + int len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); + if(len > 0) + { + WCHAR *wname = calloc(sizeof(WCHAR), len); + if(wname) + { + MultiByteToWideChar(CP_UTF8, 0, str, -1, wname, len); + logfile = _wfopen(wname, L"wt"); + free(wname); + } + } +#else + FILE *logfile = fopen(str, "wt"); +#endif if(logfile) LogFile = logfile; else ERR("Failed to open log file '%s'\n", str); } |