]> git.sesse.net Git - vlc/commitdiff
* strtof is C99 and not present on pre BSD 5 (including older Mac OSX).
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 17 Jul 2004 11:51:46 +0000 (11:51 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 17 Jul 2004 11:51:46 +0000 (11:51 +0000)
  added configure.ac check and use strtod with cast as backup since it is ANSI C

configure.ac
modules/audio_filter/equalizer.c

index 66eaffd96e61dc9f7099677490fe9c64452ec9f1..ff0ae00dbd9a769e815b3d0c84647f18a2debcaf 100644 (file)
@@ -120,7 +120,7 @@ case "${target_os}" in
     OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; OBJCFLAGS="${OBJCFLAGS_save}"
     VLC_ADD_LDFLAGS([vlc ffmpeg],[-all_load])
     VLC_ADD_LDFLAGS([mp4], [-framework IOKit -framework CoreFoundation])
-    VLC_ADD_CFLAGS([vlc],[-x objective-c])
+    VLC_ADD_CFLAGS([libvlc],[-x objective-c])
     VLC_ADD_LDFLAGS([vlc],[-Wl,-multiply_defined,suppress])
     ;;
   *mingw32* | *cygwin*)
@@ -285,7 +285,7 @@ CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcd
 dnl Check for system libs needed
 need_libc=false
 
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol strtof isatty vasprintf asprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 if_nametoindex atoll getenv putenv setenv gmtime_r ctime_r localtime_r lrintf)
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS(strdup strndup atof lseek)
index cf01e786c0deece90c52269dd902cd03af47672f..dd2a98f254148510c3dea0e4cd7de7bf7ca057bf 100644 (file)
@@ -658,7 +658,11 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd,
         for( i = 0; i < p_sys->i_band; i++ )
         {
             /* Read dB -20/20 */
+#ifdef HAVE_STRTOF
             float f = strtof( p, &p_next );
+#else
+            float f = (float) strtod( p, &p_next );
+#endif
             if( !p_next || p_next == p ) break; /* strtof() failed */
 
             p_sys->f_amp[i] = EqzConvertdB( f );