Just use stdint.h even with MSVC
diff --git a/ChangeLog b/ChangeLog
index d3ce7e4..81bb3b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
      custom config.h
 
 Changes
+   * The minimum MSVC version required is now 2010 (better C99 support).
    * The NET layer now unconditionnaly relies on getaddrinfo().
    * Remove test program o_p_test, the script compat.sh does more.
    * Remove test program ssl_test, superseded by ssl-opt.sh.
diff --git a/include/mbedtls/aes.h b/include/mbedtls/aes.h
index a773c75..ffd6d3b 100644
--- a/include/mbedtls/aes.h
+++ b/include/mbedtls/aes.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 /* padlock.c and aesni.c rely on these values! */
 #define MBEDTLS_AES_ENCRYPT     1
diff --git a/include/mbedtls/bignum.h b/include/mbedtls/bignum.h
index 88fc86e..84f47e1 100644
--- a/include/mbedtls/bignum.h
+++ b/include/mbedtls/bignum.h
@@ -31,21 +31,12 @@
 #endif
 
 #include <stddef.h>
+#include <stdint.h>
 
 #if defined(MBEDTLS_FS_IO)
 #include <stdio.h>
 #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_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. */
diff --git a/include/mbedtls/blowfish.h b/include/mbedtls/blowfish.h
index 0b7ee06..d692058 100644
--- a/include/mbedtls/blowfish.h
+++ b/include/mbedtls/blowfish.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_BLOWFISH_ENCRYPT     1
 #define MBEDTLS_BLOWFISH_DECRYPT     0
diff --git a/include/mbedtls/camellia.h b/include/mbedtls/camellia.h
index b724ed5..c160341 100644
--- a/include/mbedtls/camellia.h
+++ b/include/mbedtls/camellia.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_CAMELLIA_ENCRYPT     1
 #define MBEDTLS_CAMELLIA_DECRYPT     0
diff --git a/include/mbedtls/des.h b/include/mbedtls/des.h
index bee0921..753b3e0 100644
--- a/include/mbedtls/des.h
+++ b/include/mbedtls/des.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_DES_ENCRYPT     1
 #define MBEDTLS_DES_DECRYPT     0
diff --git a/include/mbedtls/gcm.h b/include/mbedtls/gcm.h
index b193e66..1e153f2 100644
--- a/include/mbedtls/gcm.h
+++ b/include/mbedtls/gcm.h
@@ -26,13 +26,7 @@
 
 #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>
-#endif
 
 #define MBEDTLS_GCM_ENCRYPT     1
 #define MBEDTLS_GCM_DECRYPT     0
diff --git a/include/mbedtls/md4.h b/include/mbedtls/md4.h
index d54b4c7..880c81d 100644
--- a/include/mbedtls/md4.h
+++ b/include/mbedtls/md4.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_MD4_FILE_IO_ERROR                 -0x0072  /**< Read/write error in file. */
 
diff --git a/include/mbedtls/md5.h b/include/mbedtls/md5.h
index aeed279..0e26570 100644
--- a/include/mbedtls/md5.h
+++ b/include/mbedtls/md5.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_MD5_FILE_IO_ERROR                 -0x0074  /**< Read/write error in file. */
 
diff --git a/include/mbedtls/net.h b/include/mbedtls/net.h
index f632958..85fa3e7 100644
--- a/include/mbedtls/net.h
+++ b/include/mbedtls/net.h
@@ -31,15 +31,7 @@
 #endif
 
 #include <stddef.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 */
+#include <stdint.h>
 
 #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. */
diff --git a/include/mbedtls/padlock.h b/include/mbedtls/padlock.h
index 4d3134c..c381583 100644
--- a/include/mbedtls/padlock.h
+++ b/include/mbedtls/padlock.h
@@ -35,12 +35,7 @@
 #define MBEDTLS_HAVE_X86
 #endif
 
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef INT32 int32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_PADLOCK_RNG 0x000C
 #define MBEDTLS_PADLOCK_ACE 0x00C0
diff --git a/include/mbedtls/pkcs5.h b/include/mbedtls/pkcs5.h
index f820d22..9bbdde6 100644
--- a/include/mbedtls/pkcs5.h
+++ b/include/mbedtls/pkcs5.h
@@ -30,13 +30,7 @@
 #include "md.h"
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA                  -0x2f80  /**< Bad input parameters to function. */
 #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT                  -0x2f00  /**< Unexpected ASN.1 data. */
diff --git a/include/mbedtls/ripemd160.h b/include/mbedtls/ripemd160.h
index 7a77265..390584b 100644
--- a/include/mbedtls/ripemd160.h
+++ b/include/mbedtls/ripemd160.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR              -0x007E  /**< Read/write error in file. */
 
diff --git a/include/mbedtls/sha1.h b/include/mbedtls/sha1.h
index 448c272..efaf907 100644
--- a/include/mbedtls/sha1.h
+++ b/include/mbedtls/sha1.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_SHA1_FILE_IO_ERROR                -0x0076  /**< Read/write error in file. */
 
diff --git a/include/mbedtls/sha256.h b/include/mbedtls/sha256.h
index eef07c5..e4a991f 100644
--- a/include/mbedtls/sha256.h
+++ b/include/mbedtls/sha256.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_SHA256_FILE_IO_ERROR              -0x0078  /**< Read/write error in file. */
 
diff --git a/include/mbedtls/sha512.h b/include/mbedtls/sha512.h
index 55112dd..6c61cc3 100644
--- a/include/mbedtls/sha512.h
+++ b/include/mbedtls/sha512.h
@@ -31,12 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) || defined(__WATCOMC__)
-  typedef unsigned __int64 uint64_t;
-#else
-  #include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_ERR_SHA512_FILE_IO_ERROR              -0x007A  /**< Read/write error in file. */
 
diff --git a/include/mbedtls/xtea.h b/include/mbedtls/xtea.h
index 8adadaf..1417eca 100644
--- a/include/mbedtls/xtea.h
+++ b/include/mbedtls/xtea.h
@@ -31,13 +31,7 @@
 #endif
 
 #include <stddef.h>
-
-#if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
-#include <basetsd.h>
-typedef UINT32 uint32_t;
-#else
-#include <inttypes.h>
-#endif
+#include <stdint.h>
 
 #define MBEDTLS_XTEA_ENCRYPT     1
 #define MBEDTLS_XTEA_DECRYPT     0