Use __IBM_ATTRIBUTES and __IBM_ALIGNOF__ from IBM compiler manual

This commit is contained in:
Jeffrey Walton 2018-11-22 19:18:08 -05:00
parent 2fe5177d07
commit 652d0e42bf
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
2 changed files with 4 additions and 1 deletions

View File

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

2
misc.h
View File

@ -1060,6 +1060,8 @@ inline unsigned int GetAlignmentOf()
return __alignof__(T);
#elif defined(__SUNPRO_CC)
return __alignof__(T);
#elif defined(__IBM_ALIGNOF__)
return __alignof__(T);
#elif CRYPTOPP_BOOL_SLOW_WORD64
return UnsignedMin(4U, sizeof(T));
#else