| Jean-Marc Valin | d9b9565 | 2008-08-31 23:34:47 -0400 | [diff] [blame] | 1 | dnl @synopsis AC_C99_FUNC_LRINTF |
| 2 | dnl |
| 3 | dnl Check whether C99's lrintf function is available. |
| 4 | dnl @version 1.1 |
| 5 | dnl @author Erik de Castro Lopo <erikd AT mega-nerd DOT com> |
| 6 | dnl |
| 7 | dnl Permission to use, copy, modify, distribute, and sell this file for any |
| 8 | dnl purpose is hereby granted without fee, provided that the above copyright |
| 9 | dnl and this permission notice appear in all copies. No representations are |
| 10 | dnl made about the suitability of this software for any purpose. It is |
| 11 | dnl provided "as is" without express or implied warranty. |
| 12 | dnl |
| 13 | AC_DEFUN([AC_C99_FUNC_LRINTF], |
| 14 | [AC_CACHE_CHECK(for lrintf, |
| 15 | ac_cv_c99_lrintf, |
| 16 | [AC_TRY_COMPILE([ |
| 17 | #define _ISOC9X_SOURCE 1 |
| 18 | #define _ISOC99_SOURCE 1 |
| 19 | #define __USE_ISOC99 1 |
| 20 | #define __USE_ISOC9X 1 |
| 21 | #include <math.h>], |
| 22 | [ int value = lrintf (0.432) ; ], ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no)]) |
| 23 | if test $ac_cv_c99_lrintf = yes; then |
| 24 | AC_DEFINE(HAVE_LRINTF, 1, |
| 25 | [Define if you have C99's lrintf function.]) |
| 26 | fi |
| 27 | ])# AC_C99_LRINTF |
| 28 | |
| 29 | AC_DEFUN([AC_C99_FUNC_LRINT], |
| 30 | [AC_CACHE_CHECK(for lrint, |
| 31 | ac_cv_c99_lrint, |
| 32 | [AC_TRY_COMPILE([ |
| 33 | #define _ISOC9X_SOURCE 1 |
| 34 | #define _ISOC99_SOURCE 1 |
| 35 | #define __USE_ISOC99 1 |
| 36 | #define __USE_ISOC9X 1 |
| 37 | #include <math.h>], |
| 38 | [ int value = lrint (0.432) ; ], ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no)]) |
| 39 | if test $ac_cv_c99_lrint = yes; then |
| 40 | AC_DEFINE(HAVE_LRINT, 1, |
| 41 | [Define if you have C99's lrint function.]) |
| 42 | fi |
| 43 | ])# AC_C99_LRINT |
| 44 | |