diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/open-axiom.m4 | 20 | ||||
-rw-r--r-- | config/openaxiom-c-macros.h.in | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/config/open-axiom.m4 b/config/open-axiom.m4 index a2e26e8b..d7de600a 100644 --- a/config/open-axiom.m4 +++ b/config/open-axiom.m4 @@ -1010,10 +1010,30 @@ if test x"$ac_cv_header_sys_mman_h" = xyes; then fi ]) +dnl ---------------------------------- +dnl -- OPENAXIOM_ALIGNMENT_OPERATOR -- +dnl ---------------------------------- +dnl Check that the C/C++ compiler understand +dnl alignment operator, i.e. either `alignof', +dnl or vendor lock-ins such as `__alignof'. +AC_DEFUN([OPENAXIOM_ALIGNMENT_OPERATOR],[ +AC_MSG_CHECKING([name of alignment query operator]) +oa_alignment= +AC_COMPILE_IFELSE([int a = __alignof(int);], + [oa_alignment="__alignof"], + [AC_COMPILE_IFELSE([int a = alignof(int);], + [oa_alignment="alignof"], + [AC_MSG_ERROR([C/C++ compiler does not support alignment query operator])])]) +AC_DEFINE_UNQUOTED([openaxiom_alignment],[$oa_alignment], + [Alignment query operator]) +AC_MSG_RESULT([$oa_alignment]) +]) + dnl -------------------------- dnl -- OPENAXIOM_CHECK_MISC -- dnl -------------------------- AC_DEFUN([OPENAXIOM_CHECK_MISC],[ +OPENAXIOM_ALIGNMENT_OPERATOR case $GCC in yes) CFLAGS="$CFLAGS -O2 -Wall" diff --git a/config/openaxiom-c-macros.h.in b/config/openaxiom-c-macros.h.in index c92cc8ac..41b47835 100644 --- a/config/openaxiom-c-macros.h.in +++ b/config/openaxiom-c-macros.h.in @@ -207,6 +207,9 @@ if such a type exists, and if the system does not define it. */ #undef intptr_t +/* Alignment query operator */ +#undef openaxiom_alignment + /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t |