From cb3cc53014b0d0bc01a64808ebda8eb959f60397 Mon Sep 17 00:00:00 2001
From: Ralph Giles <giles@mozilla.com>
Date: Tue, 29 Nov 2011 11:29:39 -0800
Subject: [PATCH] Fix --enable-fixed-point-debug.

Use the celt_mips defined in fixed_debug.h from the unit tests
by defining CELT_C earlier. We must export celt_mips so it can
be used by clients calling the library, like opus_custom_demo.
---
 celt/fixed_debug.h             | 3 ++-
 celt/tests/test_unit_dft.c     | 5 +----
 celt/tests/test_unit_mathops.c | 3 ---
 celt/tests/test_unit_mdct.c    | 6 ++----
 4 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/celt/fixed_debug.h b/celt/fixed_debug.h
index bce02961b..5408d904a 100644
--- a/celt/fixed_debug.h
+++ b/celt/fixed_debug.h
@@ -35,7 +35,8 @@
 #include <stdio.h>
 
 #ifdef CELT_C
-long long celt_mips=0;
+#include "opus_defines.h"
+OPUS_EXPORT long long celt_mips=0;
 #else
 extern long long celt_mips;
 #endif
diff --git a/celt/tests/test_unit_dft.c b/celt/tests/test_unit_dft.c
index 324244f34..5ca38ed1f 100644
--- a/celt/tests/test_unit_dft.c
+++ b/celt/tests/test_unit_dft.c
@@ -9,10 +9,10 @@
 #endif
 
 #include <stdio.h>
-#include "kiss_fft.h"
 
 #define CELT_C
 #include "stack_alloc.h"
+#include "kiss_fft.h"
 #include "kiss_fft.c"
 #include "mathops.c"
 #include "entcode.c"
@@ -22,9 +22,6 @@
 #define M_PI 3.141592653
 #endif
 
-#ifdef FIXED_DEBUG
-long long celt_mips=0;
-#endif
 int ret = 0;
 
 void check(kiss_fft_cpx  * in,kiss_fft_cpx  * out,int nfft,int isinverse)
diff --git a/celt/tests/test_unit_mathops.c b/celt/tests/test_unit_mathops.c
index 92a79700c..8119bc1ef 100644
--- a/celt/tests/test_unit_mathops.c
+++ b/celt/tests/test_unit_mathops.c
@@ -24,9 +24,6 @@
 #define WORD "%f"
 #endif
 
-#ifdef FIXED_DEBUG
-long long celt_mips=0;
-#endif
 int ret = 0;
 
 void testdiv(void)
diff --git a/celt/tests/test_unit_mdct.c b/celt/tests/test_unit_mdct.c
index 07ac0ffd1..0de3d546a 100644
--- a/celt/tests/test_unit_mdct.c
+++ b/celt/tests/test_unit_mdct.c
@@ -9,8 +9,9 @@
 #endif
 
 #include <stdio.h>
-#include "mdct.h"
+
 #define CELT_C
+#include "mdct.h"
 #include "stack_alloc.h"
 
 #include "kiss_fft.c"
@@ -22,9 +23,6 @@
 #define M_PI 3.141592653
 #endif
 
-#ifdef FIXED_DEBUG
-long long celt_mips=0;
-#endif
 int ret = 0;
 void check(kiss_fft_scalar  * in,kiss_fft_scalar  * out,int nfft,int isinverse)
 {
-- 
GitLab