changeset 25507:8dfe02cab924

Add detection of *lrint* and round* functions to configure.
author eugeni
date Fri, 28 Dec 2007 17:23:57 +0000
parents a5dd78186fdc
children 99d2b06cbdc7
files configure
diffstat 1 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Fri Dec 28 10:33:22 2007 +0000
+++ b/configure	Fri Dec 28 17:23:57 2007 +0000
@@ -2757,19 +2757,22 @@
 fi
 echores "$_posix4"
 
-echocheck "lrintf"
+for func in llrint lrint lrintf round roundf; do
+echocheck $func
 cat > $TMPC << EOF
 #include <math.h>
-int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
-EOF
-_lrintf=no
-cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
-if test "$_lrintf" = yes ; then
-  _def_lrintf="#define HAVE_LRINTF 1"
-else
-  _def_lrintf="#undef HAVE_LRINTF"
-fi
-echores "$_lrintf"
+int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
+EOF
+eval _$func=no
+cc_check -D_GNU_SOURCE $_ld_lm && eval _$func=yes
+if eval test "x\$_$func" = "xyes"; then
+  eval _def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\""
+  echores yes
+else
+  eval _def_$func="\"#undef HAVE_`echo $func | tr '[a-z]' '[A-Z]'`\""
+  echores no
+fi
+done
 
 
 echocheck "mkstemp"
@@ -8329,8 +8332,12 @@
 **
 *---------------------------------------------------------------------------*/
 
-/* C99 lrintf function available */
+/* C99 *lrint* and round* functions available */
+$_def_llrint
+$_def_lrint
 $_def_lrintf
+$_def_round
+$_def_roundf
 
 /* mkstemp support */
 $_def_mkstemp