Home | History | Annotate | Download | only in m4
      1 dnl
      2 dnl Copyright (c) Linux Test Project, 2016
      3 dnl
      4 dnl This program is free software;  you can redistribute it and/or modify
      5 dnl it under the terms of the GNU General Public License as published by
      6 dnl the Free Software Foundation; either version 2 of the License, or
      7 dnl (at your option) any later version.
      8 dnl
      9 dnl This program is distributed in the hope that it will be useful,
     10 dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
     11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     12 dnl the GNU General Public License for more details.
     13 dnl
     14 
     15 AC_DEFUN([LTP_CHECK_SYNC_ADD_AND_FETCH],[dnl
     16 	AC_MSG_CHECKING([for __sync_add_and_fetch])
     17 	AC_LINK_IFELSE([AC_LANG_SOURCE([
     18 int main(void) {
     19 	int i = 0;
     20 	return __sync_add_and_fetch(&i, 1);
     21 }])],[has_saac="yes"])
     22 
     23 if test "x$has_saac" = xyes; then
     24 	AC_DEFINE(HAVE_SYNC_ADD_AND_FETCH,1,[Define to 1 if you have __sync_add_and_fetch])
     25 	AC_MSG_RESULT(yes)
     26 else
     27 	AC_MSG_RESULT(no)
     28 fi
     29 ])
     30