better fix for ticket:243
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 8 May 2008 06:17:55 +0000 (06:17 +0000)
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 8 May 2008 06:17:55 +0000 (06:17 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8324 221aa14e-8319-0410-a670-987f0aec2ac5

configure.ac
gnuradio-core/src/lib/viterbi/metrics.c

index 05c2cc050e6b116bd5e0e0463a7e07fefcfe2d03..74dde0dd12c1af98223ba2c241a24e456d33710c 100644 (file)
@@ -152,6 +152,7 @@ AC_CHECK_LIB(m, sinf, [AC_DEFINE([HAVE_SINF],[1],[Define to 1 if your system has
 AC_CHECK_LIB(m, cosf, [AC_DEFINE([HAVE_COSF],[1],[Define to 1 if your system has `cosf'.])])
 AC_CHECK_LIB(m, trunc, [AC_DEFINE([HAVE_TRUNC],[1],[Define to 1 if your system has `trunc'.])])
 AC_CHECK_LIB(m, exp10, [AC_DEFINE([HAVE_EXP10],[1],[Define to 1 if your system has 'exp10'.])])
+AC_CHECK_LIB(m, log2, [AC_DEFINE([HAVE_LOG2],[1],[Define to 1 if your system has 'log2'.])])
 #AC_FUNC_MKTIME
 
 AH_BOTTOM([
index 3351ff403d9be03f09f353845805ec3436c6166d..2dd4279aaacd264a82ebb491f5c73db0f4f8db60 100644 (file)
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 /* Symbols are offset-binary, with 128 corresponding to an erased (no
  * information) symbol
  */
 /* Normal function integrated from -Inf to x. Range: 0-1 */
 #define        normal(x)       (0.5 + 0.5*erf((x)/M_SQRT2))
 
+/* Logarithm base 2 */ 
+double log2(double);           /* declaration seems to be missing from some math.h's */
+#if !defined(HAVE_LOG2)
+#define log2(x) (log(x)*M_LOG2E)
+#endif
+
 /* Generate log-likelihood metrics for 8-bit soft quantized channel
  * assuming AWGN and BPSK
  */