Paul Bakker | cce9d77 | 2011-11-18 14:26:47 +0000 | [diff] [blame] | 1 | /*
|
| 2 | * Windows CE console application entry point
|
| 3 | *
|
| 4 | * Copyright (C) 2006-2011, Brainspark B.V.
|
| 5 | *
|
| 6 | * This file is part of PolarSSL (http://www.polarssl.org)
|
| 7 | * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
|
| 8 | *
|
| 9 | * All rights reserved.
|
| 10 | *
|
| 11 | * This program is free software; you can redistribute it and/or modify
|
| 12 | * it under the terms of the GNU General Public License as published by
|
| 13 | * the Free Software Foundation; either version 2 of the License, or
|
| 14 | * (at your option) any later version.
|
| 15 | *
|
| 16 | * This program is distributed in the hope that it will be useful,
|
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 19 | * GNU General Public License for more details.
|
| 20 | *
|
| 21 | * You should have received a copy of the GNU General Public License along
|
| 22 | * with this program; if not, write to the Free Software Foundation, Inc.,
|
| 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
| 24 | */
|
| 25 |
|
| 26 | #if defined(_WIN32_WCE)
|
| 27 |
|
| 28 | #include <windows.h>
|
| 29 |
|
| 30 | extern int main( int, const char ** );
|
| 31 |
|
| 32 | int _tmain( int argc, _TCHAR* targv[] )
|
| 33 | {
|
| 34 | char **argv;
|
| 35 | int i;
|
| 36 |
|
| 37 | argv = ( char ** ) calloc( argc, sizeof( char * ) );
|
| 38 |
|
| 39 | for ( i = 0; i < argc; i++ ) {
|
| 40 | size_t len;
|
| 41 | len = _tcslen( targv[i] ) + 1;
|
| 42 | argv[i] = ( char * ) calloc( len, sizeof( char ) );
|
| 43 | wcstombs( argv[i], targv[i], len );
|
| 44 | }
|
| 45 |
|
| 46 | return main( argc, argv );
|
| 47 | }
|
| 48 |
|
| 49 | #endif /* defined(_WIN32_WCE) */
|