File tree Expand file tree Collapse file tree 3 files changed +10
-22
lines changed
Expand file tree Collapse file tree 3 files changed +10
-22
lines changed Original file line number Diff line number Diff line change 33#include < complex>
44/* #include <dsp/common.hpp> */
55#include < type_traits>
6-
7- // This is necessary to get M_PI to work on windows
8- #ifndef M_PI
9- namespace {
10- const double M_PI = std::acos(-1.0 );
11- }
12- #endif
13-
14- // Fucking Windows bollocks...
15- #ifndef M_SQRT2
16- namespace { const double M_SQRT2 = 1.41421356237309504880 ; }
17- #endif
6+ #include " ../constants.h"
187
198/* * Digital IIR filter processor. Using TDF-II structure:
209 * https://ccrma.stanford.edu/~jos/filters/Transposed_Direct_Forms.html
Original file line number Diff line number Diff line change 11#pragma once
2+
3+ // Fucking Windows bollocks...
4+
25#include <cmath>
36#ifndef MK_CONSTANTS
47#define MK_CONSTANTS
58
69// This is necessary to get M_PI to work on windows
710#ifndef M_PI
8- namespace {
9- const double M_PI = std::acos(-1.0 );
10- }
11+ #define M_PI 3.14159265358979323846
12+ #endif
13+
14+ #ifndef M_SQRT2
15+ #define M_SQRT2 1.41421356237309504880
1116#endif
1217
1318#endif
Original file line number Diff line number Diff line change 3434#include " math.h"
3535#include " mi-lookuptables.h"
3636#include < algorithm>
37+ #include " ../constants.h"
3738
3839#pragma once
3940
@@ -92,13 +93,6 @@ enum FilterMode {
9293 FILTER_MODE_HIGH_PASS
9394};
9495
95- // This is necessary to get M_PI to work on windows
96- #ifndef M_PI
97- namespace {
98- const double M_PI = std::acos(-1.0 );
99- }
100- #endif
101-
10296#define M_PI_F float (M_PI)
10397#define M_PI_POW_2 M_PI *M_PI
10498#define M_PI_POW_3 M_PI_POW_2 *M_PI
You can’t perform that action at this time.
0 commit comments