summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ruby/defines.h4
-rw-r--r--st.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index b4d7529..3235b8b 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -260,6 +260,10 @@ void rb_ia64_flushrs(void);
RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args)
#endif
+#if !defined(UNALIGNED_WORD_ACCESS) && defined(__GNUC__) && __GNUC__ >= 6
+# define UNALIGNED_WORD_ACCESS 0
+#endif
+
#ifndef UNALIGNED_WORD_ACCESS
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \
diff --git a/st.c b/st.c
index 9b79704..086ae4d 100644
--- a/st.c
+++ b/st.c
@@ -1379,6 +1379,10 @@ strhash(st_data_t arg)
}
#else
+#if !defined(UNALIGNED_WORD_ACCESS) && defined(__GNUC__) && __GNUC__ >= 6
+# define UNALIGNED_WORD_ACCESS 0
+#endif
+
#ifndef UNALIGNED_WORD_ACCESS
# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \