mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 19:35:39 +01:00
- Rewrote bignum type definition #ifdef tree to work better on all
systems
This commit is contained in:
parent
3338b792da
commit
62261d6bd6
@ -109,25 +109,41 @@ typedef UINT64 uint64_t;
|
||||
typedef signed char t_sint;
|
||||
typedef unsigned char t_uint;
|
||||
typedef uint16_t t_udbl;
|
||||
#define POLARSSL_HAVE_UDBL
|
||||
#else
|
||||
#if defined(POLARSSL_HAVE_INT16)
|
||||
typedef int16_t t_sint;
|
||||
typedef uint16_t t_uint;
|
||||
typedef uint32_t t_udbl;
|
||||
#define POLARSSL_HAVE_UDBL
|
||||
#else
|
||||
typedef int32_t t_sint;
|
||||
typedef uint32_t t_uint;
|
||||
#if ( defined(_MSC_VER) && defined(_M_IX86) ) || \
|
||||
( defined(__GNUC__) && ( \
|
||||
#if ( defined(__MSC_VER) && defined(_M_AMD64) )
|
||||
typedef int64_t t_sint;
|
||||
typedef uint64_t t_uint;
|
||||
#else
|
||||
#if ( defined(__GNUC__) && ( \
|
||||
defined(__amd64__) || defined(__x86_64__) || \
|
||||
defined(__ppc64__) || defined(__powerpc64__) || \
|
||||
defined(__ia64__) || defined(__alpha__) || \
|
||||
(defined(__sparc__) && defined(__arch64__)) || \
|
||||
defined(__s390x__) ) )
|
||||
#define POLARSSL_HAVE_INT64
|
||||
#endif
|
||||
#if defined(POLARSSL_HAVE_INT64)
|
||||
typedef int64_t t_sint;
|
||||
typedef uint64_t t_uint;
|
||||
typedef unsigned int t_udbl __attribute__((mode(TI)));
|
||||
#define POLARSSL_HAVE_UDBL
|
||||
#else
|
||||
typedef int32_t t_sint;
|
||||
typedef uint32_t t_uint;
|
||||
#if ( defined(_MSC_VER) && defined(_M_IX86) )
|
||||
typedef uint64_t t_udbl;
|
||||
#define POLARSSL_HAVE_UDBL
|
||||
#else
|
||||
#if defined( POLARSSL_HAVE_LONGLONG )
|
||||
typedef unsigned long long t_udbl;
|
||||
#define POLARSSL_HAVE_UDBL
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* POLARSSL_HAVE_INT16 */
|
||||
#endif /* POLARSSL_HAVE_INT8 */
|
||||
|
@ -61,14 +61,12 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def POLARSSL_HAVE_INT64
|
||||
* \def POLARSSL_HAVE_LONGLONG
|
||||
*
|
||||
* The compiler supports the use of 64-bit types.
|
||||
* Code automatically enables on known working systems.
|
||||
*
|
||||
* Uncomment if the compiler supports 64-bit data types.
|
||||
#define POLARSSL_HAVE_INT64
|
||||
* The compiler supports the 'long long' type.
|
||||
* (Only used on 32-bit platforms)
|
||||
*/
|
||||
#define POLARSSL_HAVE_LONGLONG
|
||||
|
||||
/**
|
||||
* \def POLARSSL_HAVE_ASM
|
||||
|
@ -1102,7 +1102,7 @@ int mpi_div_mpi( mpi *Q, mpi *R, const mpi *A, const mpi *B )
|
||||
Z.p[i - t - 1] = ~0;
|
||||
else
|
||||
{
|
||||
#if defined(POLARSSL_HAVE_INT64)
|
||||
#if defined(POLARSSL_HAVE_UDBL)
|
||||
t_udbl r;
|
||||
|
||||
r = (t_udbl) X.p[i] << biL;
|
||||
|
Loading…
Reference in New Issue
Block a user