mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Prefer alignas() over _Alignas()
to allow Intel C++ compiler to read ruby.h.
This is similar to 9930481a23
This commit is contained in:
parent
3e12b65861
commit
df26d36e5b
1 changed files with 8 additions and 3 deletions
11
configure.ac
11
configure.ac
|
@ -1359,10 +1359,11 @@ AS_IF([test "$rb_cv_va_args_macro" = yes], [
|
||||||
|
|
||||||
AC_CACHE_CHECK([for alignas() syntax], rb_cv_have_alignas, [
|
AC_CACHE_CHECK([for alignas() syntax], rb_cv_have_alignas, [
|
||||||
rb_cv_have_alignas=no
|
rb_cv_have_alignas=no
|
||||||
|
# Prefer alignas over _Alignas to allow C++ compiler to read ruby.h
|
||||||
RUBY_WERROR_FLAG([
|
RUBY_WERROR_FLAG([
|
||||||
for attr in \
|
for attr in \
|
||||||
"_Alignas(x)" \
|
|
||||||
"alignas(x)" \
|
"alignas(x)" \
|
||||||
|
"_Alignas(x)" \
|
||||||
"@<:@@<:@alignas(x)@:>@@:>@" \
|
"@<:@@<:@alignas(x)@:>@@:>@" \
|
||||||
"__declspec(aligned(x))" \
|
"__declspec(aligned(x))" \
|
||||||
"__attribute__((__aligned__(x)))" \
|
"__attribute__((__aligned__(x)))" \
|
||||||
|
@ -1371,8 +1372,11 @@ do
|
||||||
# C11 _Alignas and GCC __attribute__((__aligned__)) behave
|
# C11 _Alignas and GCC __attribute__((__aligned__)) behave
|
||||||
# slightly differently. What we want is GCC's. Check that
|
# slightly differently. What we want is GCC's. Check that
|
||||||
# here by something C11 does not allow (`struct ALIGNAS ...`)
|
# here by something C11 does not allow (`struct ALIGNAS ...`)
|
||||||
AC_TRY_COMPILE(
|
AC_TRY_COMPILE([
|
||||||
[@%:@define ALIGNAS(x) $attr
|
@%:@ifdef HAVE_STDALIGN_H
|
||||||
|
@%:@include <stdalign.h>
|
||||||
|
@%:@endif
|
||||||
|
@%:@define ALIGNAS(x) $attr
|
||||||
struct ALIGNAS(128) conftest_tag { int foo; } foo; ], [],
|
struct ALIGNAS(128) conftest_tag { int foo; } foo; ], [],
|
||||||
[rb_cv_have_alignas="$attr"; break], [])
|
[rb_cv_have_alignas="$attr"; break], [])
|
||||||
done
|
done
|
||||||
|
@ -1383,6 +1387,7 @@ AS_IF([test "$rb_cv_have_alignas" != no], [
|
||||||
|
|
||||||
AC_CACHE_CHECK([for alignof() syntax], rb_cv_have_alignof,[
|
AC_CACHE_CHECK([for alignof() syntax], rb_cv_have_alignof,[
|
||||||
rb_cv_have_alignof=no
|
rb_cv_have_alignof=no
|
||||||
|
# Prefer alignof over _Alignof to allow C++ compiler to read ruby.h
|
||||||
RUBY_WERROR_FLAG([
|
RUBY_WERROR_FLAG([
|
||||||
for expr in \
|
for expr in \
|
||||||
"alignof" \
|
"alignof" \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue