Build mono runtime under none desktop Windows API family, adjustments and cleanup.
[mono.git] / eglib / src / gunicode-win32.c
1 /*
2  * gunicode-win32.c: Windows unicode support.
3  *
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>
9
10 #if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
11 #define CODESET 1
12 #include <windows.h>
13
14 extern const char *my_charset;
15 static gboolean is_utf8;
16
17 gboolean
18 g_get_charset (G_CONST_RETURN char **charset)
19 {
20         if (my_charset == NULL) {
21                 static char buf [14];
22                 sprintf (buf, "CP%u", GetACP ());
23                 my_charset = buf;
24                 is_utf8 = FALSE;
25         }
26         
27         if (charset != NULL)
28                 *charset = my_charset;
29
30         return is_utf8;
31 }
32
33 #else /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */
34
35 #ifdef _MSC_VER
36 // Quiet Visual Studio linker warning, LNK4221, in cases when this source file intentional ends up empty.
37 void __mono_win32_mono_gunicode_win32_quiet_lnk4221(void) {}
38 #endif
39 #endif /* G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT) */