Commit a161f154 authored by Michel Lespinasse's avatar Michel Lespinasse
Browse files

configure-time support for the restrict keyword.

parent 8642528b
dnl AC_C_RESTRICT
dnl Do nothing if the compiler accepts the restrict keyword.
dnl Otherwise define restrict to __restrict__ or __restrict if one of
dnl those work, otherwise define restrict to be empty.
AC_DEFUN([AC_C_RESTRICT],
[ac_cv_c_inline=no
for ac_kw in restrict __restrict__ __restrict; do
AC_TRY_COMPILE([],[char * $ac_kw p;],[ac_cv_c_restrict=$ac_kw; break])
done
case $ac_cv_c_restrict in
restrict) ;;
no) AC_DEFINE([restrict],,
[Define as `__restrict' if that's what the C compiler calls
it, or to nothing if it is not supported.]) ;;
*) AC_DEFINE_UNQUOTED([restrict],$ac_cv_c_restrict) ;;
esac])
dnl AC_C_ATTRIBUTE_ALIGNED
dnl define ATTRIBUTE_ALIGNED_MAX to the maximum alignment if this is supported
AC_DEFUN([AC_C_ATTRIBUTE_ALIGNED],
......
......@@ -95,6 +95,7 @@ AC_CHECK_GENERATE_INTTYPES([include])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_C_BIGENDIAN
......
......@@ -101,5 +101,9 @@
if it is not supported. */
#define inline __inline
/* Define as `__restrict' if that's what the C compiler calls it, or to
nothing if it is not supported. */
#define restrict __restrict
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment