diff --git a/src/analyzer.cpp b/src/analyzer.cpp index 83e36e7c6..34f3bc60d 100644 --- a/src/analyzer.cpp +++ b/src/analyzer.cpp @@ -35,6 +35,11 @@ using namespace calf_plugins; #define sinc(x) (x == 0) ? 1 : sin(M_PI * x)/(M_PI * x); #define RGBAtoINT(r, g, b, a) ((uint32_t)(r * 255) << 24) + ((uint32_t)(g * 255) << 16) + ((uint32_t)(b * 255) << 8) + (uint32_t)(a * 255) +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + + analyzer::analyzer() { _accuracy = -1; _acc = -1; diff --git a/src/audio_fx.cpp b/src/audio_fx.cpp index 5933e21f7..712ef0001 100644 --- a/src/audio_fx.cpp +++ b/src/audio_fx.cpp @@ -29,6 +29,14 @@ using namespace calf_plugins; using namespace dsp; +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + +#ifndef M_PI_2 +# define M_PI_2 1.57079632679489661923 /* pi/2 */ +#endif + simple_phaser::simple_phaser(int _max_stages, float *x1vals, float *y1vals) { max_stages = _max_stages; diff --git a/src/calf/biquad.h b/src/calf/biquad.h index 95c4a39ca..28ca20e5b 100644 --- a/src/calf/biquad.h +++ b/src/calf/biquad.h @@ -26,6 +26,10 @@ #include #include "primitives.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + namespace dsp { /** diff --git a/src/calf/loudness.h b/src/calf/loudness.h index 74da4af91..c68cb7607 100644 --- a/src/calf/loudness.h +++ b/src/calf/loudness.h @@ -25,6 +25,11 @@ #include "biquad.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + + namespace dsp { class aweighter { diff --git a/src/calf/primitives.h b/src/calf/primitives.h index de3245f45..561e40080 100644 --- a/src/calf/primitives.h +++ b/src/calf/primitives.h @@ -30,6 +30,11 @@ #include #include +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + + namespace dsp { /// Set a float to zero diff --git a/src/modules_dist.cpp b/src/modules_dist.cpp index a6679ca24..bce16a52f 100644 --- a/src/modules_dist.cpp +++ b/src/modules_dist.cpp @@ -50,6 +50,10 @@ using namespace calf_plugins; #define SET_IF_CONNECTED(name) if (params[AM::param_##name] != NULL) *params[AM::param_##name] = name; +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327 +#endif + /********************************************************************** * SATURATOR by Markus Schmidt **********************************************************************/ diff --git a/src/veal.cpp b/src/veal.cpp index fd3b283ff..d3c3913af 100644 --- a/src/veal.cpp +++ b/src/veal.cpp @@ -528,7 +528,6 @@ const LV2_Descriptor *lv2_descriptor(uint32_t index) #if USE_LADSPA extern "C" { - const LADSPA_Descriptor *ladspa_descriptor(unsigned long Index) { #define PER_MODULE_ITEM(name, isSynth, jackname) if (!isSynth && !(Index--)) return &ladspa_wrapper::get().descriptor;