diff options
author | James Ross-Gowan <rossy@jrg.systems> | 2017-11-18 22:36:20 +1100 |
---|---|---|
committer | James Ross-Gowan <rossy@jrg.systems> | 2017-11-19 21:10:56 +1100 |
commit | 0bdbe2bc53fc2e927084dfd2c21e452d83b26e1d (patch) | |
tree | 1c1e09d00c89e5584eb3d34a34e49c10ebe609a7 /osdep/io.c | |
parent | cd6f964b567d77c01971277a908824e3b01db86f (diff) | |
download | mpv-0bdbe2bc53fc2e927084dfd2c21e452d83b26e1d.tar.bz2 mpv-0bdbe2bc53fc2e927084dfd2c21e452d83b26e1d.tar.xz |
win32: fix semantics of POSIX 2008 locale stubs
This sliences some warnings about unused values and statements with no
effect, but it also fixes a logic error with freelocale(), since
previously it would not work as expected when used in the body of an if
statement without braces.
Uses real functions, because with macros, I don't think there is a way
to silence the "statement with no effect" warnings in the case where the
return value of uselocale() is ignored.
As for replacing the these functions with working implementations, I
don't think this is possible for mpv's use-case, since MSVCRT does not
support UTF-8 locales, or any locale with multibyte characters that are
three or more bytes long. See:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setlocale-wsetlocale
Diffstat (limited to 'osdep/io.c')
-rw-r--r-- | osdep/io.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/osdep/io.c b/osdep/io.c index a49ee82638..3b2061e55b 100644 --- a/osdep/io.c +++ b/osdep/io.c @@ -799,4 +799,18 @@ int msync(void *addr, size_t length, int flags) } #endif +locale_t newlocale(int category, const char *locale, locale_t base) +{ + return (locale_t)1; +} + +locale_t uselocale(locale_t locobj) +{ + return (locale_t)1; +} + +void freelocale(locale_t locobj) +{ +} + #endif // __MINGW32__ |