summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-05-29 20:16:57 +0200
committerGravatar waker <wakeroid@gmail.com>2012-05-29 20:16:57 +0200
commitf105f91a9194758b43048d4211a5cf4eec3cdf93 (patch)
treeb54c44d8fa6d84cb8fe58a8ad0de07ed56cc4985
parent3edecc6c5443c2c9dc26619c7311caf6a062ebdc (diff)
added proper log2 detection to configure and dumb plugin
-rw-r--r--configure.ac3
-rw-r--r--plugins/dumb/dumb-kode54/src/it/itrender.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index c5f7dd89..781b0a7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,9 @@ fi
dnl check for yasm
AC_CHECK_PROG(HAVE_YASM, yasm, yes, no)
+dnl check for log2
+AC_CHECK_LIB([m], [log2], AC_DEFINE([HAVE_LOG2], [], [Define to 1 if the system has log2 in libm]))
+
dnl check for libdl
AC_CHECK_LIB([dl], [main], [HAVE_DL=yes;DL_LIBS="-ldl";AC_SUBST(DL_LIBS)])
diff --git a/plugins/dumb/dumb-kode54/src/it/itrender.c b/plugins/dumb/dumb-kode54/src/it/itrender.c
index b69bb765..06aba111 100644
--- a/plugins/dumb/dumb-kode54/src/it/itrender.c
+++ b/plugins/dumb/dumb-kode54/src/it/itrender.c
@@ -17,6 +17,10 @@
* \__/
*/
+#ifdef HAVE_CONFIG_H
+#include "../../../../../config.h"
+#endif
+
#include <math.h>
#include <stdlib.h>
@@ -3558,8 +3562,8 @@ static void process_playing(DUMB_IT_SIGRENDERER *sigrenderer, IT_PLAYING *playin
playing->sample_vibrato_time += playing->sample->vibrato_speed;
}
-#if !(_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L)
-static inline float log2(float x) {return (float)log(x)/(float)log(2.0f);}
+#ifndef HAVE_LOG2
+static inline float log2(float x) {return (float)log(x)/M_LN2;}
#endif
static int delta_to_note(float delta, int base)