Just use stdint.h even with MSVC

This commit is contained in:
Manuel Pégourié-Gonnard 2015-04-15 11:53:16 +02:00
parent b85725c958
commit ab22910191
17 changed files with 16 additions and 114 deletions

View file

@ -61,6 +61,7 @@ Default behavior changes
custom config.h custom config.h
Changes Changes
* The minimum MSVC version required is now 2010 (better C99 support).
* The NET layer now unconditionnaly relies on getaddrinfo(). * The NET layer now unconditionnaly relies on getaddrinfo().
* Remove test program o_p_test, the script compat.sh does more. * Remove test program o_p_test, the script compat.sh does more.
* Remove test program ssl_test, superseded by ssl-opt.sh. * Remove test program ssl_test, superseded by ssl-opt.sh.

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
/* padlock.c and aesni.c rely on these values! */ /* padlock.c and aesni.c rely on these values! */
#define MBEDTLS_AES_ENCRYPT 1 #define MBEDTLS_AES_ENCRYPT 1

View file

@ -31,21 +31,12 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(MBEDTLS_FS_IO) #if defined(MBEDTLS_FS_IO)
#include <stdio.h> #include <stdio.h>
#endif #endif
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef INT32 int32_t;
typedef INT64 int64_t;
typedef UINT32 uint32_t;
typedef UINT64 uint64_t;
#else
#include <inttypes.h>
#endif /* _MSC_VER && !EFIX64 && !EFI32 */
#define MBEDTLS_ERR_MPI_FILE_IO_ERROR -0x0002 /**< An error occurred while reading from or writing to a file. */ #define MBEDTLS_ERR_MPI_FILE_IO_ERROR -0x0002 /**< An error occurred while reading from or writing to a file. */
#define MBEDTLS_ERR_MPI_BAD_INPUT_DATA -0x0004 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_MPI_BAD_INPUT_DATA -0x0004 /**< Bad input parameters to function. */
#define MBEDTLS_ERR_MPI_INVALID_CHARACTER -0x0006 /**< There is an invalid character in the digit string. */ #define MBEDTLS_ERR_MPI_INVALID_CHARACTER -0x0006 /**< There is an invalid character in the digit string. */

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_BLOWFISH_ENCRYPT 1 #define MBEDTLS_BLOWFISH_ENCRYPT 1
#define MBEDTLS_BLOWFISH_DECRYPT 0 #define MBEDTLS_BLOWFISH_DECRYPT 0

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_CAMELLIA_ENCRYPT 1 #define MBEDTLS_CAMELLIA_ENCRYPT 1
#define MBEDTLS_CAMELLIA_DECRYPT 0 #define MBEDTLS_CAMELLIA_DECRYPT 0

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_DES_ENCRYPT 1 #define MBEDTLS_DES_ENCRYPT 1
#define MBEDTLS_DES_DECRYPT 0 #define MBEDTLS_DES_DECRYPT 0

View file

@ -26,13 +26,7 @@
#include "cipher.h" #include "cipher.h"
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
typedef UINT64 uint64_t;
#else
#include <stdint.h> #include <stdint.h>
#endif
#define MBEDTLS_GCM_ENCRYPT 1 #define MBEDTLS_GCM_ENCRYPT 1
#define MBEDTLS_GCM_DECRYPT 0 #define MBEDTLS_GCM_DECRYPT 0

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_MD4_FILE_IO_ERROR -0x0072 /**< Read/write error in file. */ #define MBEDTLS_ERR_MD4_FILE_IO_ERROR -0x0072 /**< Read/write error in file. */

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_MD5_FILE_IO_ERROR -0x0074 /**< Read/write error in file. */ #define MBEDTLS_ERR_MD5_FILE_IO_ERROR -0x0074 /**< Read/write error in file. */

View file

@ -31,15 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(MBEDTLS_HAVE_TIME)
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#endif /* MBEDTLS_HAVE_TIME */
#define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */ #define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */
#define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */ #define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */

View file

@ -35,12 +35,7 @@
#define MBEDTLS_HAVE_X86 #define MBEDTLS_HAVE_X86
#endif #endif
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32) #include <stdint.h>
#include <basetsd.h>
typedef INT32 int32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_PADLOCK_RNG 0x000C #define MBEDTLS_PADLOCK_RNG 0x000C
#define MBEDTLS_PADLOCK_ACE 0x00C0 #define MBEDTLS_PADLOCK_ACE 0x00C0

View file

@ -30,13 +30,7 @@
#include "md.h" #include "md.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */
#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR -0x007E /**< Read/write error in file. */ #define MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR -0x007E /**< Read/write error in file. */

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_SHA1_FILE_IO_ERROR -0x0076 /**< Read/write error in file. */ #define MBEDTLS_ERR_SHA1_FILE_IO_ERROR -0x0076 /**< Read/write error in file. */

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_SHA256_FILE_IO_ERROR -0x0078 /**< Read/write error in file. */ #define MBEDTLS_ERR_SHA256_FILE_IO_ERROR -0x0078 /**< Read/write error in file. */

View file

@ -31,12 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) || defined(__WATCOMC__)
typedef unsigned __int64 uint64_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_ERR_SHA512_FILE_IO_ERROR -0x007A /**< Read/write error in file. */ #define MBEDTLS_ERR_SHA512_FILE_IO_ERROR -0x007A /**< Read/write error in file. */

View file

@ -31,13 +31,7 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <stdint.h>
#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
#include <basetsd.h>
typedef UINT32 uint32_t;
#else
#include <inttypes.h>
#endif
#define MBEDTLS_XTEA_ENCRYPT 1 #define MBEDTLS_XTEA_ENCRYPT 1
#define MBEDTLS_XTEA_DECRYPT 0 #define MBEDTLS_XTEA_DECRYPT 0