From 1c0dc8b34c953b2c27a8241874696db867e9a4a2 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 5 Oct 2019 23:19:31 +0200 Subject: [PATCH] Ref T730, avoid math DEFINE warnings if values are already defined --- src/blacksound/dsp/SimpleHeader.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/blacksound/dsp/SimpleHeader.h b/src/blacksound/dsp/SimpleHeader.h index 2e54e998d..df346be7a 100644 --- a/src/blacksound/dsp/SimpleHeader.h +++ b/src/blacksound/dsp/SimpleHeader.h @@ -26,16 +26,17 @@ * DEALINGS IN THE SOFTWARE. */ +#ifndef BLACKSOUND_DSP_SIMPLE_HEADER_H +#define BLACKSOUND_DSP_SIMPLE_HEADER_H -#ifndef __SIMPLE_HEADER_H__ -#define __SIMPLE_HEADER_H__ - -#if _MSC_VER > 1000 // MS Visual Studio -#define INLINE __forceinline // forces inline -#define NOMINMAX // for standard library min(), max() -#define _USE_MATH_DEFINES // for math constants -#else // other IDE's -#define INLINE inline +#if _MSC_VER > 1000 // MS Visual Studio +# define INLINE __forceinline // forces inline +# define NOMINMAX // for standard library min(), max() +# ifndef M_PI +# define _USE_MATH_DEFINES // for math constants +# endif +#else // other IDE's +# define INLINE inline #endif #include // for min(), max()