Commit 46ff5086 authored by Diogo Franco's avatar Diogo Franco Committed by Fiona Glaser
Browse files

Add configure check for log2 support

Some incredibly braindamaged operating systems, such as FreeBSD, blatantly ignore the C specification and omit certain functions that are required by ISO C.
log2f is one of these functions that periodically goes missing in such operating systems.
parent ac759e90
......@@ -34,6 +34,10 @@
#include <inttypes.h>
#endif
#ifndef HAVE_LOG2F
#define log2f(x) (logf((x))/0.693147180559945f)
#endif
#ifdef _WIN32
#include <io.h> // _setmode()
#include <fcntl.h> // _O_BINARY
......
......@@ -477,6 +477,10 @@ if test "$pthread" = "yes" ; then
LDFLAGS="$LDFLAGS $libpthread"
fi
if cc_check "math.h" "-Werror" "return log2f(2);" ; then
CFLAGS="$CFLAGS -DHAVE_LOG2F"
fi
if [ "$lavf_input" = "auto" ] ; then
lavf_input="no"
if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>$DEVNULL; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment