Add CRYPTOPP_ALIGN_DATA for IBM XL C/C++

pull/696/head
Jeffrey Walton 2018-07-30 20:32:45 -04:00
parent d563c5da94
commit 00135f5b5b
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 4 additions and 0 deletions

View File

@ -355,11 +355,15 @@ NAMESPACE_END
#endif #endif
// Sun Studio Express 3 (December 2006) provides GCC-style attributes. // Sun Studio Express 3 (December 2006) provides GCC-style attributes.
// IBM XL C/C++ alignment modifier per Optimization Guide, pp. 19-20.
// CRYPTOPP_ALIGN_DATA may not be reliable on AIX.
#ifndef CRYPTOPP_ALIGN_DATA #ifndef CRYPTOPP_ALIGN_DATA
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x)) #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
#elif defined(__GNUC__) || (__SUNPRO_CC >= 0x5100) #elif defined(__GNUC__) || (__SUNPRO_CC >= 0x5100)
#define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x))) #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
#elif defined(__xlc__) || defined(__xlC__)
#define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
#else #else
#define CRYPTOPP_ALIGN_DATA(x) #define CRYPTOPP_ALIGN_DATA(x)
#endif #endif