gitlab-ci: Set GIT_SUBMODULE_FORCE_HTTPS
[ghc.git] / m4 / fp_check_alignment.m4
bloba000c42582fff5de921931011365babf3ad80c2b
1 # FP_CHECK_ALIGNMENT(TYPE, [IGNORED], [INCLUDES = DEFAULT-INCLUDES])
2 # ------------------------------------------------------------------
3 # A variation of AC_CHECK_SIZEOF for computing the alignment restrictions of a
4 # given type. Defines ALIGNMENT_TYPE.
5 AC_DEFUN([FP_CHECK_ALIGNMENT],
6 [AS_LITERAL_IF(m4_translit([[$1]], [*], [p]), [],
7                [AC_FATAL([$0: requires literal arguments])])[]dnl
8 AC_CHECK_TYPE([$1], [], [], [$3])[]dnl
9 m4_pushdef([fp_Cache], [AS_TR_SH([fp_cv_alignment_$1])])[]dnl
10 AC_CACHE_CHECK([alignment of $1], [fp_Cache],
11 [if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
12   FP_COMPUTE_INT([offsetof(struct { char c; $1 ty; },ty)],
13                  [fp_Cache],
14                  [AC_INCLUDES_DEFAULT([$3])],
15                  [AC_MSG_ERROR([cannot compute alignment ($1)
16 See `config.log' for more details.], [77])])
17 else
18   fp_Cache=0
19 fi])[]dnl
20 AC_DEFINE_UNQUOTED(AS_TR_CPP(alignment_$1), $fp_Cache, [The alignment of a `$1'.])[]dnl
21 m4_popdef([fp_Cache])[]dnl
22 ])# FP_CHECK_ALIGNMENT