File indexing completed on 2025-01-18 09:54:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef CRYPTOPP_CONFIG_ALIGN_H
0023 #define CRYPTOPP_CONFIG_ALIGN_H
0024
0025 #include "config_asm.h" // CRYPTOPP_DISABLE_ASM
0026 #include "config_cpu.h" // X86, X32, X64, ARM32, ARM64, etc
0027 #include "config_cxx.h" // CRYPTOPP_CXX11_ALIGNAS
0028 #include "config_ver.h" // Compiler versions
0029
0030
0031
0032
0033 #if defined(CRYPTOPP_DISABLE_ASM)
0034 #define CRYPTOPP_BOOL_ALIGN16 0
0035 #elif (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || \
0036 CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64)
0037 #define CRYPTOPP_BOOL_ALIGN16 1
0038 #else
0039 #define CRYPTOPP_BOOL_ALIGN16 0
0040 #endif
0041
0042
0043
0044 #if defined(CRYPTOPP_MSC_VERSION)
0045 #define CRYPTOPP_MM_MALLOC_AVAILABLE
0046 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
0047 #define CRYPTOPP_MEMALIGN_AVAILABLE
0048 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
0049 #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
0050 #elif (defined(_GNU_SOURCE) || ((_XOPEN_SOURCE + 0) >= 600)) && (_POSIX_ADVISORY_INFO > 0)
0051 #define CRYPTOPP_POSIX_MEMALIGN_AVAILABLE
0052 #else
0053 #define CRYPTOPP_NO_ALIGNED_ALLOC
0054 #endif
0055
0056
0057
0058
0059
0060 #if defined(CRYPTOPP_CXX11_ALIGNAS)
0061 #define CRYPTOPP_ALIGN_DATA(x) alignas(x)
0062 #elif defined(CRYPTOPP_MSC_VERSION)
0063 #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
0064 #elif defined(__GNUC__) || defined(__clang__) || (__SUNPRO_CC >= 0x5100)
0065 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
0066 #elif defined(__xlc__) || defined(__xlC__)
0067 #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
0068 #else
0069 #define CRYPTOPP_ALIGN_DATA(x)
0070 #endif
0071
0072 #endif