1a8e1175bSopenharmony_ci/*
2a8e1175bSopenharmony_ci *  Windows CE console application entry point
3a8e1175bSopenharmony_ci *
4a8e1175bSopenharmony_ci *  Copyright The Mbed TLS Contributors
5a8e1175bSopenharmony_ci *  SPDX-License-Identifier: Apache-2.0
6a8e1175bSopenharmony_ci *
7a8e1175bSopenharmony_ci *  Licensed under the Apache License, Version 2.0 (the "License"); you may
8a8e1175bSopenharmony_ci *  not use this file except in compliance with the License.
9a8e1175bSopenharmony_ci *  You may obtain a copy of the License at
10a8e1175bSopenharmony_ci *
11a8e1175bSopenharmony_ci *  http://www.apache.org/licenses/LICENSE-2.0
12a8e1175bSopenharmony_ci *
13a8e1175bSopenharmony_ci *  Unless required by applicable law or agreed to in writing, software
14a8e1175bSopenharmony_ci *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15a8e1175bSopenharmony_ci *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16a8e1175bSopenharmony_ci *  See the License for the specific language governing permissions and
17a8e1175bSopenharmony_ci *  limitations under the License.
18a8e1175bSopenharmony_ci */
19a8e1175bSopenharmony_ci
20a8e1175bSopenharmony_ci#if defined(_WIN32_WCE)
21a8e1175bSopenharmony_ci
22a8e1175bSopenharmony_ci#include <windows.h>
23a8e1175bSopenharmony_ci
24a8e1175bSopenharmony_ciextern int main(int, const char **);
25a8e1175bSopenharmony_ci
26a8e1175bSopenharmony_ciint _tmain(int argc, _TCHAR *targv[])
27a8e1175bSopenharmony_ci{
28a8e1175bSopenharmony_ci    char **argv;
29a8e1175bSopenharmony_ci    int i;
30a8e1175bSopenharmony_ci
31a8e1175bSopenharmony_ci    argv = (char **) calloc(argc, sizeof(char *));
32a8e1175bSopenharmony_ci
33a8e1175bSopenharmony_ci    for (i = 0; i < argc; i++) {
34a8e1175bSopenharmony_ci        size_t len;
35a8e1175bSopenharmony_ci        len = _tcslen(targv[i]) + 1;
36a8e1175bSopenharmony_ci        argv[i] = (char *) calloc(len, sizeof(char));
37a8e1175bSopenharmony_ci        wcstombs(argv[i], targv[i], len);
38a8e1175bSopenharmony_ci    }
39a8e1175bSopenharmony_ci
40a8e1175bSopenharmony_ci    return main(argc, argv);
41a8e1175bSopenharmony_ci}
42a8e1175bSopenharmony_ci
43a8e1175bSopenharmony_ci#endif  /* defined(_WIN32_WCE) */
44