Fix hardclock with some versions of mingw64

Backport of 383433535 from the 1.3 branch
This commit is contained in:
Manuel Pégourié-Gonnard 2015-04-10 17:34:32 +02:00
parent a9553a8c49
commit 7e82884811
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,8 @@ Security
crash it remotely (found by Caj Larsson).
Bugfix
* Fix hardclock() (only used in the benchmarking program) with some
versions of mingw64 (found by kxjhlele).
* Fix warnings from mingw64 in timing.c (found by kxjklele).
* Fix potential unintended sign extension in asn1_get_len() on 64-bit
platforms (found with Coverity Scan).

View file

@ -65,8 +65,10 @@ unsigned long hardclock( void )
}
#endif
/* some versions of mingw-64 have 32-bit longs even on x84_64 */
#if !defined(POLARSSL_HAVE_HARDCLOCK) && defined(POLARSSL_HAVE_ASM) && \
defined(__GNUC__) && defined(__i386__)
defined(__GNUC__) && ( defined(__i386__) || ( \
( defined(__amd64__) || defined( __x86_64__) ) && __SIZEOF_LONG__ == 4 ) )
#define POLARSSL_HAVE_HARDCLOCK