mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
3f21aa5d38
commit
6528ad0971
2 changed files with 20 additions and 2 deletions
|
@ -1336,8 +1336,6 @@ AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
|
|||
packed_struct_unaligned=x
|
||||
if test "$rb_cv_packed_struct" != no; then
|
||||
AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], [$rb_cv_packed_struct])
|
||||
AS_CASE(["$target_cpu"],
|
||||
[x86*|i?86|x64], [packed_struct_unaligned='PACKED_STRUCT(x)'])
|
||||
else
|
||||
AC_DEFINE_UNQUOTED([PACKED_STRUCT(x)], x)
|
||||
fi
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue