diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-23 14:50:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-23 14:50:02 +0000 |
commit | 6528ad097135cf0a18c6e313217474935670a928 (patch) | |
tree | 3c7fc3d2c2c1416811f525b8991d2772fe29a4d5 /include | |
parent | 3f21aa5d386100dcf7f133a0debd3f0094713c0d (diff) |
defines.h: PACKED_STRUCT_UNALIGNED
* include/ruby/defines.h (PACKED_STRUCT_UNALIGNED): move from
configure.in for universal binary.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/defines.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h index b84e4f5ad2..0a192d70d2 100644 --- a/include/ruby/defines.h +++ b/include/ruby/defines.h @@ -261,6 +261,26 @@ void rb_ia64_flushrs(void); RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args) #endif +#ifndef UNALIGNED_WORD_ACCESS +# if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || \ + defined(__mc68020__) +# define UNALIGNED_WORD_ACCESS 1 +# else +# define UNALIGNED_WORD_ACCESS 0 +# endif +#endif +#ifndef PACKED_STRUCT +# define PACKED_STRUCT(x) x +#endif +#ifndef PACKED_STRUCT_UNALIGNED +# if UNALIGNED_WORD_ACCESS +# define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x) +# else +# define PACKED_STRUCT_UNALIGNED(x) x +# endif +#endif + RUBY_SYMBOL_EXPORT_END #if defined(__cplusplus) |