diff options
author | 卜部昌平 <[email protected]> | 2023-08-25 14:21:55 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2023-08-25 17:27:53 +0900 |
commit | 12ec1fb2b16be65f546151da85cbe842ca90dc3b (patch) | |
tree | 378a2f34fc5587561d4b5a20db9128d7dc676142 /ext/fiddle/fiddle.h | |
parent | fa54406f50c1c79a835e68cbc015ff7fc86ed92b (diff) |
use configure-detected sanity of _Alignof
This is actually already checked in (Ruby's) configure.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8274
Diffstat (limited to 'ext/fiddle/fiddle.h')
-rw-r--r-- | ext/fiddle/fiddle.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/fiddle/fiddle.h b/ext/fiddle/fiddle.h index 5a31a4bdb8..53db058807 100644 --- a/ext/fiddle/fiddle.h +++ b/ext/fiddle/fiddle.h @@ -199,7 +199,10 @@ /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>. clang versions < 8.0.0 have the same bug. */ -#if (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112 \ +#if defined(HAVE__ALIGNOF) +# /* Autoconf detected availability of a sane `_Alignof()`. */ +# define ALIGN_OF(type) RB_GNUC_EXTENSION(_Alignof(type)) +#elif (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112 \ || (defined(__GNUC__) && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ && !defined(__clang__)) \ || (defined(__clang__) && __clang_major__ < 8)) |