aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2023-08-25 14:21:55 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2023-08-25 17:27:53 +0900
commit12ec1fb2b16be65f546151da85cbe842ca90dc3b (patch)
tree378a2f34fc5587561d4b5a20db9128d7dc676142 /ext
parentfa54406f50c1c79a835e68cbc015ff7fc86ed92b (diff)
downloadruby-12ec1fb2b16be65f546151da85cbe842ca90dc3b.tar.gz
use configure-detected sanity of _Alignof
This is actually already checked in (Ruby's) configure.
Diffstat (limited to 'ext')
-rw-r--r--ext/fiddle/fiddle.h5
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))