Autoconfiscate log2f.

Android doesn't supply log2f for us (though it does have all the other
float calls ruamoko wants).
This commit is contained in:
Bill Currie 2012-02-05 14:23:33 +09:00
parent 5fdad1c79c
commit 3bd75cefd8
2 changed files with 12 additions and 0 deletions

View file

@ -69,3 +69,11 @@ AC_TRY_LINK(
AC_MSG_RESULT(no)
)
AM_CONDITIONAL(BUILD_GETOPT, test "x$BUILD_GETOPT" = "xyes")
AC_MSG_CHECKING(for log2f)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <math.h>]], [float (*foo)(float) = log2f;])],
AC_DEFINE(HAVE_LOG2F, 1, [Define if you have log2f.])
[HAVE_LOG2F=yes],
[HAVE_LOG2F=no])
AC_MSG_RESULT($HAVE_LOG2F)

View file

@ -95,7 +95,11 @@ bi_log (progs_t *pr)
static void
bi_log2 (progs_t *pr)
{
#ifdef HAVE_LOG2F
R_FLOAT (pr) = log2f (P_FLOAT (pr, 0));
#else
R_FLOAT (pr) = logf (P_FLOAT (pr, 0)) / M_LOG2E;
#endif
}
static void