From 409f8da265275e81221aa568dd07f8409af01edd Mon Sep 17 00:00:00 2001
From: Sergey Ulanov <sergeyu@chromium.org>
Date: Wed, 9 Apr 2014 18:47:00 -0700
Subject: [PATCH] Fix onyx_if.c to not to redefine M_LOG2_E if it's already
 defined.

This fixes warning when compiling libvpx for PNaCl. PNaCl's version
of math.h defines M_LOG2_E.

Change-Id: Iba9450441538e9f82447ad2936bea94d21bafdf1
---
 vp8/encoder/onyx_if.c     | 3 +++
 vp9/encoder/vp9_onyx_if.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index ef37c0e37e..32c5997913 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -1761,8 +1761,11 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
 
 }
 
+#ifndef M_LOG2_E
 #define M_LOG2_E 0.693147180559945309417
+#endif
 #define log2f(x) (log (x) / (float) M_LOG2_E)
+
 static void cal_mvsadcosts(int *mvsadcost[2])
 {
     int i = 1;
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 0ac9d5f054..2f13814761 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -906,7 +906,9 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
   cpi->ext_refresh_frame_context_pending = 0;
 }
 
+#ifndef M_LOG2_E
 #define M_LOG2_E 0.693147180559945309417
+#endif
 #define log2f(x) (log (x) / (float) M_LOG2_E)
 
 static void cal_nmvjointsadcost(int *mvjointsadcost) {
-- 
GitLab