1 /*
2  *  Windows CE console application entry point
3  *
4  *  Copyright The Mbed TLS Contributors
5  *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
6  */
7 
8 #if defined(_WIN32_WCE)
9 
10 #include <windows.h>
11 
12 extern int main(int, const char **);
13 
_tmain(int argc,_TCHAR * targv[])14 int _tmain(int argc, _TCHAR *targv[])
15 {
16     char **argv;
17     int i;
18 
19     argv = (char **) calloc(argc, sizeof(char *));
20 
21     for (i = 0; i < argc; i++) {
22         size_t len;
23         len = _tcslen(targv[i]) + 1;
24         argv[i] = (char *) calloc(len, sizeof(char));
25         wcstombs(argv[i], targv[i], len);
26     }
27 
28     return main(argc, argv);
29 }
30 
31 #endif  /* defined(_WIN32_WCE) */
32