diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-24 11:10:11 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-24 11:10:11 +0000 |
commit | 131e4bec04f40f3dd020ce7fd8467c6a58105baa (patch) | |
tree | 547e5666f873bfb217ac57d8057982d1a39e8538 /configure.in | |
parent | fa7b849f946c37422d27ce601582a7aa24eed0e3 (diff) | |
download | ruby-131e4bec04f40f3dd020ce7fd8467c6a58105baa.tar.gz |
time: only use packed struct on x86*
* configure.in: define PACKED_STRUCT_UNALIGNED for x86*
* timev.h (struct vtm): use PACKED_STRUCT_UNALIGNED
* time.c (struct time_object): ditto
[Bug #9558] non-x86 cannot safely access unaligned addresses
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 8d7bfba55e..aa5899bb96 100644 --- a/configure.in +++ b/configure.in @@ -1277,8 +1277,12 @@ AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct, [rb_cv_packed_struct=yes], [rb_cv_packed_struct=no])]) if test "$rb_cv_packed_struct" = yes; then AC_DEFINE_UNQUOTED(PACKED_STRUCT, __attribute__((packed))) + AS_CASE(["$target_cpu"], + [x86*|x?86], [AC_DEFINE_UNQUOTED(PACKED_STRUCT_UNALIGNED, PACKED_STRUCT)], + [AC_DEFINE_UNQUOTED(PACKED_STRUCT_UNALIGNED,)]) else AC_DEFINE_UNQUOTED(PACKED_STRUCT,) + AC_DEFINE_UNQUOTED(PACKED_STRUCT_UNALIGNED,) fi AC_DEFUN([RUBY_CHECK_PRINTF_PREFIX], [ |