mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 23:11:38 +00:00
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:
parent
5fdad1c79c
commit
3bd75cefd8
2 changed files with 12 additions and 0 deletions
|
@ -69,3 +69,11 @@ AC_TRY_LINK(
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
)
|
)
|
||||||
AM_CONDITIONAL(BUILD_GETOPT, test "x$BUILD_GETOPT" = "xyes")
|
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)
|
||||||
|
|
|
@ -95,7 +95,11 @@ bi_log (progs_t *pr)
|
||||||
static void
|
static void
|
||||||
bi_log2 (progs_t *pr)
|
bi_log2 (progs_t *pr)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LOG2F
|
||||||
R_FLOAT (pr) = log2f (P_FLOAT (pr, 0));
|
R_FLOAT (pr) = log2f (P_FLOAT (pr, 0));
|
||||||
|
#else
|
||||||
|
R_FLOAT (pr) = logf (P_FLOAT (pr, 0)) / M_LOG2E;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue