summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael E. Locasto <michael@freshdefense.net>2010-08-27 15:08:09 (GMT)
committer Michael E. Locasto <michael@freshdefense.net>2010-08-27 15:08:09 (GMT)
commit7221bef1b9bc3f59b097976d8830fb38042231b3 (patch)
treed881cd9d5d2ef85521aac59ce1f1199b316a8df5
parentc10540c5fb09dcc9e0b6a7e5142113f3c29e5856 (diff)
push log2 Makefile fix and FreeBSD macro definition
-rw-r--r--code/CONTRIBUTORS17
-rw-r--r--code/src/Makefile2
-rw-r--r--code/src/disorder.c4
3 files changed, 15 insertions, 8 deletions
diff --git a/code/CONTRIBUTORS b/code/CONTRIBUTORS
index 0b56c58..7af7714 100644
--- a/code/CONTRIBUTORS
+++ b/code/CONTRIBUTORS
@@ -1,15 +1,18 @@
libdisorder Contributors
$Id$
-==================================================================
+=====================================================================
-libdisorder was originally written and produced by Michael E. Locasto
+libdisorder was originally written and produced by Michael E. Locasto
<michael@freshdefense.net>
The first version of libdisorder was produced on March 4th, 2010.
-Other contributions include:
-
-<NAME> (MAIL) :: \nContribution...
-Michael E. Locasto (michael@freshdefense.net) ::
+---------------------------------------------------------------------
+Michael E. Locasto (michael @ freshdefense.net) ::
Created first version and set up website.
-
+Kevin Lo (kevlo.org) ::
+ Submitted patch for Makefile to use libm and using log2 on BSD,
+ OpenBSD and FreeBSD ports maintainer.
+Jaromil http://jaromil.dyne.org/journal/who.html ::
+ Hosting code at dyne.org git repo,
+ Debian package maintainer
diff --git a/code/src/Makefile b/code/src/Makefile
index ba38e11..e599b42 100644
--- a/code/src/Makefile
+++ b/code/src/Makefile
@@ -1,6 +1,6 @@
LDFLAGS=-L../lib -L/usr/lib
INCLUDES=-I/usr/include -I../include
-LIBS=-ldisorder
+LIBS=-ldisorder -lm
#OPTS=-Wall -g -pg
OPTS=-Wall -g
TESTOUT=../test/testexec
diff --git a/code/src/disorder.c b/code/src/disorder.c
index 9d297e5..822d3e2 100644
--- a/code/src/disorder.c
+++ b/code/src/disorder.c
@@ -25,6 +25,10 @@
#include <stdio.h> //for NULL
#include "../include/disorder.h"
+#if defined(__FreeBSD__)
+#define log2(x) (log((x)) * (1./M_LN2))
+#endif
+
/** Frequecies for each byte */
static int m_token_freqs[LIBDO_MAX_BYTES]; //frequency of each token in sample
static float m_token_probs[LIBDO_MAX_BYTES]; //P(each token appearing)