1dnl SPDX-License-Identifier: GPL-2.0-or-later 2dnl Copyright (c) Linux Test Project, 2016 3 4AC_DEFUN([LTP_CHECK_SYNC_ADD_AND_FETCH],[ 5 AC_MSG_CHECKING([for __sync_add_and_fetch]) 6 AC_LINK_IFELSE([AC_LANG_SOURCE([ 7int main(void) { 8 int i = 0; 9 return __sync_add_and_fetch(&i, 1); 10}])],[has_saac="yes"]) 11 12if test "x$has_saac" = xyes; then 13 AC_DEFINE(HAVE_SYNC_ADD_AND_FETCH,1,[Define to 1 if you have __sync_add_and_fetch]) 14 AC_MSG_RESULT(yes) 15else 16 AC_MSG_RESULT(no) 17fi 18]) 19