]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
b2sum: simplify attribute usage
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Nov 2021 05:30:38 +0000 (22:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 1 Nov 2021 05:36:46 +0000 (22:36 -0700)
* src/blake2/blake2.h (BLAKE2_PACKED): Simplify, and port better
to older GCC, by using _GL_ATTRIBUTE_PACKED.

src/blake2/blake2.h

index 3960bdb2dc284848662cb068ece72264a1362e14..dc4672d1d8655781d73fb9c307842a2ec638fa3b 100644 (file)
 #include <stddef.h>
 #include <stdint.h>
 
-#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)