1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

- Lots of minimal changes to better support WINCE as a build target

This commit is contained in:
Paul Bakker
2011-11-18 14:26:47 +00:00
parent 33008eef64
commit cce9d77745
41 changed files with 392 additions and 161 deletions

View File

@ -2,7 +2,7 @@
* \brief Generic file encryption program using generic wrappers for configured
* security.
*
* Copyright (C) 2006-2010, Brainspark B.V.
* Copyright (C) 2006-2011, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@ -30,7 +30,9 @@
#if defined(_WIN32)
#include <windows.h>
#if !defined(_WIN32_WCE)
#include <io.h>
#endif
#else
#include <sys/types.h>
#include <unistd.h>
@ -56,8 +58,11 @@
"\n"
#if !defined(POLARSSL_CIPHER_C) || !defined(POLARSSL_MD_C)
int main( void )
int main( int argc, char *argv[] )
{
((void) argc);
((void) argv);
printf("POLARSSL_CIPHER_C and/or POLARSSL_MD_C not defined.\n");
return( 0 );
}
@ -80,7 +85,9 @@ int main( int argc, char *argv[] )
const md_info_t *md_info;
cipher_context_t cipher_ctx;
md_context_t md_ctx;
#if defined(WIN32)
#if defined(_WIN32_WCE)
long filesize, offset;
#elif defined(_WIN32)
LARGE_INTEGER li_size;
__int64 filesize, offset;
#else
@ -117,7 +124,7 @@ int main( int argc, char *argv[] )
list++;
}
#if defined(WIN32)
#if defined(_WIN32)
printf( "\n Press Enter to exit this program.\n" );
fflush( stdout ); getchar();
#endif
@ -205,7 +212,10 @@ int main( int argc, char *argv[] )
memset( argv[6], 0, strlen( argv[6] ) );
#if defined(WIN32)
#if defined(_WIN32_WCE)
filesize = fseek( fin, 0L, SEEK_END );
#else
#if defined(_WIN32)
/*
* Support large files (> 2Gb) on Win32
*/
@ -227,6 +237,7 @@ int main( int argc, char *argv[] )
perror( "lseek" );
goto exit;
}
#endif
#endif
if( fseek( fin, 0, SEEK_SET ) < 0 )