summaryrefslogtreecommitdiffstats
path: root/m4/fr_have_builtin_bswap64.m4
blob: ab205c95089bbff1ca6857a14c542254021ae1ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
dnl #
dnl #  Check if we have the bwsap64 builtin
dnl #
AC_DEFUN([FR_HAVE_BUILTIN_BSWAP64],
[
  AC_CACHE_CHECK([for __builtin_bswap64 support in compiler], [ax_cv_cc_builtin_bswap64],[
    AC_RUN_IFELSE(
      [
        AC_LANG_SOURCE([
          int main(int argc, char **argv) {
            if ((argc < 0) || !argv) return 1; /* -Werror=unused-parameter */
            return (__builtin_bswap64(0));
          }
        ])
      ],
      [ax_cv_cc_builtin_bswap64=yes],
      [ax_cv_cc_builtin_bswap64=no]
    )
  ])
  if test "x$ax_cv_cc_builtin_bswap64" = "xyes"; then
    AC_DEFINE([HAVE_BUILTIN_BSWAP_64],1,[Define if the compiler supports __builtin_bswap64])
  fi
])