Fix minizip compile on Haiku (#16301)
[mono-project.git] / mono / eglib / gunicode-win32-uwp.c
blobe64493c95e33e5c14b5cd229cbe5b1adbc48c8b8
1 /*
2 * gunicode-win32-uwp.c: UWP unicode support.
4 * Copyright 2016 Microsoft
5 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 */
7 #include <config.h>
8 #include <glib.h>
10 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
11 #define CODESET 1
12 #include <windows.h>
14 extern const char *eg_my_charset;
15 static gboolean is_utf8;
17 gboolean
18 g_get_charset (G_CONST_RETURN char **charset)
20 if (eg_my_charset == NULL) {
21 static char buf [14];
22 CPINFOEXW cp_info;
24 GetCPInfoExW (CP_ACP, 0, &cp_info);
25 sprintf (buf, "CP%u", cp_info.CodePage);
26 eg_my_charset = buf;
27 is_utf8 = FALSE;
30 if (charset != NULL)
31 *charset = eg_my_charset;
33 return is_utf8;
36 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
38 #ifdef _MSC_VER
39 // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
40 void __mono_win32_gunicode_win32_uwp_quiet_lnk4221(void) {}
41 #endif
42 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */