From 20886059fd88724f724da8601a82e04fc3f03a53 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 28 Mar 2014 00:37:42 -0700 Subject: Wrap fopen calls under Windows The idea is that all filenames we deal with are encoded as UTF-8, but the Windows functions that take a char string interpret it using the ANSI codepage. So instead, we convert the UTF-8 string to a wchar string, and then use the wchar functions for proper extended character filename support. --- Alc/compat.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Alc/compat.h') diff --git a/Alc/compat.h b/Alc/compat.h index 1c80e7c5..426dad9d 100644 --- a/Alc/compat.h +++ b/Alc/compat.h @@ -23,6 +23,9 @@ inline int alsched_yield(void) WCHAR *strdupW(const WCHAR *str); +/* Opens a file with standard I/O. The filename is expected to be UTF-8. */ +FILE *al_fopen(const char *fname, const char *mode); + #define HAVE_DYNLOAD 1 #else @@ -50,6 +53,8 @@ void Sleep(ALuint t); #define alsched_yield sched_yield +#define al_fopen(_n, _m) fopen((_n), (_m)) + #if defined(HAVE_DLFCN_H) && !defined(IN_IDE_PARSER) #define HAVE_DYNLOAD 1 #endif -- cgit v1.2.3