streamvolume: Define cbrt() if it's not available
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 7 Oct 2009 05:28:15 +0000 (07:28 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 7 Oct 2009 05:28:15 +0000 (07:28 +0200)
Fixes build on Win32, bug #597537.

configure.ac
gst-libs/gst/interfaces/streamvolume.c

index 0c5b57234156b395750fb54e5b2e47243afca5b4..5245fc4b72c91f5b9e908b977b899b6a9161bbbf 100644 (file)
@@ -202,6 +202,12 @@ AX_CREATE_STDINT_H
 dnl *** checks for functions ***
 AC_CHECK_FUNCS([localtime_r gmtime_r])
 
+dnl *** checks for math functions ***
+LIBS_SAVE=$LIBS
+LIBS="$LIBS $LIBM"
+AC_CHECK_FUNCS(cbrt)
+LIBS=$LIBS_SAVE
+
 dnl *** checks for types/defines ***
 
 dnl Check for FIONREAD ioctl declaration
index 4a65f15b27e2a38a714d852f01e35e1c908aa73c..a3efe468cbcf26ec040c55af639badb8d87caa53 100644 (file)
 #include "streamvolume.h"
 #include <math.h>
 
+#ifndef HAVE_CBRT
+#define cbrt(x) (pow(abs(x),1.0/3.0))
+#endif
+
 static void
 gst_stream_volume_class_init (GstStreamVolumeInterface * iface)
 {