]> code.delx.au - pulseaudio/commitdiff
strtof() is a rather recent addition to C. Fall back to strtod() if it isn't
authorPierre Ossman <ossman@cendio.se>
Tue, 18 Sep 2007 10:47:03 +0000 (10:47 +0000)
committerPierre Ossman <ossman@cendio.se>
Tue, 18 Sep 2007 10:47:03 +0000 (10:47 +0000)
available.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1853 fefdeb5f-60dc-0310-8127-8f9354f1896f

configure.ac
src/pulsecore/core-util.c

index 5250804b405e90b3ff7bac5edf7166a4c4ef52b6..d03774ed638bf25a706dc143c8e0820e4fdbdcf2 100644 (file)
@@ -267,7 +267,7 @@ AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
 #### Check for functions ####
 
 # ISO
-AC_CHECK_FUNCS([lrintf])
+AC_CHECK_FUNCS([lrintf strtof])
 
 # POSIX
 AC_FUNC_FORK
index 6a0bd0ac9fbfaecfc0de37960067e1cf3f08537e..afd89badad8a141372008a514cf38cf7d34c2d2e 100644 (file)
@@ -1300,7 +1300,11 @@ int pa_atof(const char *s, float *ret_f) {
 #endif
     {
         errno = 0;
+#ifdef HAVE_STRTOF
         f = strtof(s, &x);
+#else
+        f = strtod(s, &x);
+#endif
     }
 
     if (!x || *x || errno != 0)