blob: b9367d1d5f4f4a1bd73e9abdcd3b3432384e8f6c [file] [log] [blame]
Paul Bakkercce9d772011-11-18 14:26:47 +00001/*
2 * Windows CE console application entry point
3 *
Paul Bakker530927b2015-02-13 14:24:10 +01004 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Paul Bakkercce9d772011-11-18 14:26:47 +00005 *
Manuel Pégourié-Gonnarde12abf92015-01-28 17:13:45 +00006 * This file is part of mbed TLS (https://polarssl.org)
Paul Bakkercce9d772011-11-18 14:26:47 +00007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#if defined(_WIN32_WCE)
24
25#include <windows.h>
26
27extern int main( int, const char ** );
28
29int _tmain( int argc, _TCHAR* targv[] )
30{
31 char **argv;
32 int i;
33
34 argv = ( char ** ) calloc( argc, sizeof( char * ) );
35
36 for ( i = 0; i < argc; i++ ) {
37 size_t len;
38 len = _tcslen( targv[i] ) + 1;
39 argv[i] = ( char * ) calloc( len, sizeof( char ) );
40 wcstombs( argv[i], targv[i], len );
41 }
42
43 return main( argc, argv );
44}
45
46#endif /* defined(_WIN32_WCE) */