Define log2(x) on Windows
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 22 Oct 2012 08:37:38 +0000 (10:37 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 22 Oct 2012 08:37:38 +0000 (10:37 +0200)
This is because log2 is not defined by math.h on Windows.

src/relevance.c

index 9766a5b..d22598d 100644 (file)
@@ -28,6 +28,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "relevance.h"
 #include "session.h"
 
+#ifdef WIN32
+#define log2(x) (log(x)/log(2))
+#endif
+
 struct relevance
 {
     int *doc_frequency_vec;