+dnl #
+dnl # Check if we have the choose expr builtin
+dnl #
+AC_DEFUN([FR_HAVE_BUILTIN_CHOOSE_EXPR],
+[
+ AC_MSG_CHECKING(for __builtin_choose_expr support in compiler)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ int main(int argc, char **argv) {
+ return __builtin_choose_expr(0, 1, 0);
+ }
+ ]])
+ ],[have_builtin_choose_expr=yes],[have_builtin_choose_expr=no],[have_builtin_choose_expr=no])
+ AC_MSG_RESULT($have_builtin_choose_expr)
+ if test "x$have_builtin_choose_expr" = "xyes"; then
+ AC_DEFINE([HAVE_BUILTIN_CHOOSE_EXPR],1,[Define if the compiler supports __builtin_choose_expr])
+ fi
+])
+
+dnl #
+dnl # Check if we have the types compatible p builtin
+dnl #
+AC_DEFUN([FR_HAVE_BUILTIN_TYPES_COMPATIBLE_P],
+[
+ AC_MSG_CHECKING(for __builtin_types_compatible_p support in compiler)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ int main(int argc, char **argv) {
+ return !(__builtin_types_compatible_p(char *, char *));
+ }
+ ]])
+ ],[have_builtin_types_compatible_p=yes],[have_builtin_types_compatible_p=no],[have_builtin_types_compatible_p=no])
+ AC_MSG_RESULT($have_builtin_types_compatible_p)
+ if test "x$have_builtin_types_compatible_p" = "xyes"; then
+ AC_DEFINE([HAVE_BUILTIN_TYPES_COMPATIBLE_P],1,[Define if the compiler supports __builtin_types_compatible_p])
+ fi
+])
+
+dnl #
+dnl # Check if we have the bwsap64 builtin
+dnl #
+AC_DEFUN([FR_HAVE_BUILTIN_BSWAP_64],
+[
+dnl #
+dnl # See if the compilation works with __thread, for thread-local storage
+dnl #
+ AC_MSG_CHECKING(for __builtin_bswap64 support in compiler)
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE(
+ [[
+ int main(int argc, char **argv) {
+ return (__builtin_bswap64(0));
+ }
+ ]])
+ ],[have_builtin_bswap64=yes],[have_builtin_bswap64=no],[have_builtin_bswap64=no])
+ AC_MSG_RESULT($have_builtin_bswap64)
+ if test "x$have_builtin_bswap64" = "xyes"; then
+ AC_DEFINE([HAVE_BUILTIN_BSWAP_64],1,[Define if the compiler supports __builtin_types_compatible_p])
+ fi
+])
+