summaryrefslogtreecommitdiff
path: root/gl/lib
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2016-11-25 22:10:20 +0000
committerPádraig Brady <P@draigBrady.com>2016-11-27 00:27:45 +0000
commit12f6214d07ad93814bad81cb384e087792068213 (patch)
tree186736dec69241d7d851bb6b7e1687c6f28bb147 /gl/lib
parentc7c0c8b65981ab2163269ac8869ac763dc9f15c2 (diff)
downloadcoreutils-12f6214d07ad93814bad81cb384e087792068213.tar.xz
shred,sort: ensure faster unaligned access to rand module
glibc has changed the public define from _STRING_ARCH_unaligned to _STRING_INLINE_unaligned as per https://sourceware.org/bugzilla/show_bug.cgi?id=19462 * gl/lib/rand-isaac.c: Cater for both defines. * gl/lib/randread.c: Likewise. * src/system.h: Update commented out code.
Diffstat (limited to 'gl/lib')
-rw-r--r--gl/lib/rand-isaac.c2
-rw-r--r--gl/lib/randread.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gl/lib/rand-isaac.c b/gl/lib/rand-isaac.c
index 5ad9cae01..349bf0e23 100644
--- a/gl/lib/rand-isaac.c
+++ b/gl/lib/rand-isaac.c
@@ -40,7 +40,7 @@
/* If the platform supports unaligned access,
then don't have -fsanitize=undefined warn about it. */
#undef ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED
-#if !_STRING_ARCH_unaligned \
+#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) \
|| __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
# define ATTRIBUTE_NO_WARN_SANITIZE_UNDEFINED /* empty */
#else
diff --git a/gl/lib/randread.c b/gl/lib/randread.c
index ff85d5649..2d211a084 100644
--- a/gl/lib/randread.c
+++ b/gl/lib/randread.c
@@ -60,7 +60,7 @@
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
-#if _STRING_ARCH_unaligned
+#if _STRING_ARCH_unaligned || _STRING_INLINE_unaligned
# define ALIGNED_POINTER(ptr, type) true
#else
# define ALIGNED_POINTER(ptr, type) ((size_t) (ptr) % alignof (type) == 0)