diff options
Diffstat (limited to 'c/common/platform.h')
-rwxr-xr-x | c/common/platform.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/c/common/platform.h b/c/common/platform.h index 0d84b19..84c448c 100755 --- a/c/common/platform.h +++ b/c/common/platform.h @@ -71,7 +71,7 @@ OR: */ #if BROTLI_GNUC_HAS_BUILTIN(__builtin_expect, 3, 0, 0) || \ BROTLI_INTEL_VERSION_CHECK(16, 0, 0) || \ - BROTLI_SUNPRO_VERSION_CHECK(5, 12, 0) || \ + BROTLI_SUNPRO_VERSION_CHECK(5, 15, 0) || \ BROTLI_ARM_VERSION_CHECK(4, 1, 0) || \ BROTLI_IBM_VERSION_CHECK(10, 1, 0) || \ BROTLI_TI_VERSION_CHECK(7, 3, 0) || \ @@ -180,6 +180,12 @@ OR: #define BROTLI_UNUSED_FUNCTION static BROTLI_INLINE #endif +#if BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0) +#define BROTLI_ALIGNED(N) __attribute__((aligned(N))) +#else +#define BROTLI_ALIGNED(N) +#endif + #if (defined(__ARM_ARCH) && (__ARM_ARCH == 7)) || \ (defined(M_ARM) && (M_ARM == 7)) #define BROTLI_TARGET_ARMV7 @@ -197,6 +203,10 @@ OR: #endif /* ARMv8 */ +#if defined(__ARM_NEON__) || defined(__ARM_NEON) +#define BROTLI_TARGET_NEON +#endif + #if defined(__i386) || defined(_M_IX86) #define BROTLI_TARGET_X86 #endif @@ -343,7 +353,7 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) { /* If __attribute__(aligned) is available, use that. Otherwise, memcpy. */ #if BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0) -typedef __attribute__((aligned(1))) uint64_t brotli_unaligned_uint64_t; +typedef BROTLI_ALIGNED(1) uint64_t brotli_unaligned_uint64_t; static BROTLI_INLINE uint64_t BrotliUnalignedRead64(const void* p) { return (uint64_t) ((brotli_unaligned_uint64_t*) p)[0]; |