1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Correctly detect whether strict alignment is needed on OpenBSD

From Stefan Sperling <stsp@apache.org>
This commit is contained in:
Jeremy Evans 2020-03-12 15:45:03 -07:00
parent 768bd6e533
commit 00dc8c0246

View file

@ -841,6 +841,16 @@ rb_iseq_original_iseq(const rb_iseq_t *iseq) /* cold path */
#define STRICT_ALIGNMENT
#endif
/*
* Some OpenBSD platforms (including sparc64) require strict alignment.
*/
#if defined(__OpenBSD__)
#include <sys/endian.h>
#ifdef __STRICT_ALIGNMENT
#define STRICT_ALIGNMENT
#endif
#endif
#ifdef STRICT_ALIGNMENT
#if defined(HAVE_TRUE_LONG_LONG) && SIZEOF_LONG_LONG > SIZEOF_VALUE
#define ALIGNMENT_SIZE SIZEOF_LONG_LONG