clang does not like the c-like definition of alignof

This commit is contained in:
christos 2018-07-14 23:42:23 +00:00
parent 985fdf2eac
commit d6b79c318e

View File

@ -230,7 +230,11 @@ sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
# ifdef __clang__
# define alignof(type) __alignof__(type)
# else
# define alignof(type) offsetof (struct { char c; type x; }, x)
# endif
# define UNALIGNED_P(p) (((size_t) p) % alignof (sha1_uint32) != 0)
if (UNALIGNED_P (buffer))
while (len > 64)