From: Paul Eggert Date: Mon, 1 Nov 2021 05:30:38 +0000 (-0700) Subject: b2sum: simplify attribute usage X-Git-Tag: v9.1~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a9bacee502b581e701724a695af7aaf29d1c195;p=thirdparty%2Fcoreutils.git b2sum: simplify attribute usage * src/blake2/blake2.h (BLAKE2_PACKED): Simplify, and port better to older GCC, by using _GL_ATTRIBUTE_PACKED. --- diff --git a/src/blake2/blake2.h b/src/blake2/blake2.h index 3960bdb2dc..dc4672d1d8 100644 --- a/src/blake2/blake2.h +++ b/src/blake2/blake2.h @@ -18,18 +18,12 @@ #include #include -#ifdef __has_attribute -# if __has_attribute (packed) -# define BLAKE2_PACKED(x) x __attribute__ ((packed)) -# endif -#endif -#if !defined BLAKE2_PACKED && defined _MSC_VER +/* Pack a structure if possible. This might save space, and is not + needed for correctness. */ +#ifdef _MSC_VER # define BLAKE2_PACKED(x) __pragma (pack (push, 1)) x __pragma (pack (pop)) -#endif -#ifndef BLAKE2_PACKED -/* This should be good enough on other platforms. - If it's not good on yours, please file a bug report. */ -# define BLAKE2_PACKED(x) x +#else +# define BLAKE2_PACKED(x) x _GL_ATTRIBUTE_PACKED #endif #if defined(__cplusplus)