Merge pull request #8093 from yuhaoth/pr/add-target-architecture-macros
Add architecture detection macros
This commit is contained in:
commit
f22999e99f
8 changed files with 55 additions and 45 deletions
|
@ -49,6 +49,31 @@
|
|||
#define MBEDTLS_VERSION_STRING "3.4.1"
|
||||
#define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 3.4.1"
|
||||
|
||||
/* Macros for build-time platform detection */
|
||||
|
||||
#if !defined(MBEDTLS_ARCH_IS_ARM64) && \
|
||||
(defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC))
|
||||
#define MBEDTLS_ARCH_IS_ARM64
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_ARCH_IS_ARM32) && \
|
||||
(defined(__arm__) || defined(_M_ARM) || \
|
||||
defined(_M_ARMT) || defined(__thumb__) || defined(__thumb2__))
|
||||
#define MBEDTLS_ARCH_IS_ARM32
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_ARCH_IS_X64) && \
|
||||
(defined(__amd64__) || defined(__x86_64__) || \
|
||||
((defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)))
|
||||
#define MBEDTLS_ARCH_IS_X64
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_ARCH_IS_X86) && \
|
||||
(defined(__i386__) || defined(_X86_) || \
|
||||
(defined(_M_IX86) && !defined(_M_I86)))
|
||||
#define MBEDTLS_ARCH_IS_X86
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue