From 914d4a6ac9b1d9138d417d6be8deee62cd8e882c Mon Sep 17 00:00:00 2001
From: Marek Blok <marek.blok@pg.edu.pl>
Date: Tue, 14 Mar 2023 13:12:00 +0100
Subject: [PATCH] Linux: fixed defined conflicting with consts

---
 CHANGELOG               |  2 ++
 src/Main.cpp            |  2 +-
 src/include/DSP_lib.h   |  2 +-
 src/include/DSP_types.h | 27 ++++++++++++++-------------
 4 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 4975e55..ceb2994 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,8 @@ TODO::
 LAST DONE:
 
 CHANGES:
+- ver. 0.20.014 - <b>2023.03.014/b> Changed: 
+  - DSP::M_Ef and simmilar constants changed to DSP::M_E_f and simmilar; because of conflitcs with defines when _GNU_SOURCE is defined
 - ver. 0.20.011 - <b>2022.03.01</b> Changed: 
   - DOT: changed record shape into HTML shape with HTML-like labels to avoid flat edge errors
 - ver. 0.20.010 - <b>2021.12.19</b> Changed: 
diff --git a/src/Main.cpp b/src/Main.cpp
index 333f240..3ec2569 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -2928,7 +2928,7 @@ polling:
     const int no_of_channels = 2;
     for (auto ind=0; ind < float_signal.size()/no_of_channels; ind++) {
       //float_signal[no_of_channels*ind]   = sin(6000.0 / Fs * ind); // M.B. można usłyszeć nieciągłość fazy na łączeniach poszczególnych segmentów
-      float_signal[no_of_channels*ind]   = sin(2*DSP::M_PIf * 1000.0 / Fs * ind); // M.B. brak nieciągłość fazy na łączeniach poszczególnych segmentów
+      float_signal[no_of_channels*ind]   = sin(2*DSP::M_PI_f * 1000.0 / Fs * ind); // M.B. brak nieciągłość fazy na łączeniach poszczególnych segmentów
       float_signal[no_of_channels*ind+1] = 0;
     }
 
diff --git a/src/include/DSP_lib.h b/src/include/DSP_lib.h
index 85e18e6..fa8114e 100644
--- a/src/include/DSP_lib.h
+++ b/src/include/DSP_lib.h
@@ -11,7 +11,7 @@
 
 #define DSP_VER_MAJOR 0
 #define DSP_VER_MINOR 20
-#define DSP_VER_BUILD 13 // !!! without zeroes before, else this will be treated as octal number
+#define DSP_VER_BUILD 14 // !!! without zeroes before, else this will be treated as octal number
 #define DSP_VER_YEAR  2023
 #define DSP_VER       DSP_VER_MAJOR.DSP_VER_MINOR.DSP_VER_BUILD
 
diff --git a/src/include/DSP_types.h b/src/include/DSP_types.h
index 5f2cb5e..50f2857 100644
--- a/src/include/DSP_types.h
+++ b/src/include/DSP_types.h
@@ -135,19 +135,20 @@ namespace DSP {
   const long double M_PIx2_prec = 6.28318530718058647692528676656;
 
   // and DSP::Float precision
-  const DSP::Float M_Ef         = DSP::Float(M_E);
-  const DSP::Float M_LOG2Ef     = DSP::Float(M_LOG2E);
-  const DSP::Float M_LOG10Ef    = DSP::Float(M_LOG10E);
-  const DSP::Float M_LN2f       = DSP::Float(M_LN2);
-  const DSP::Float M_LN10f      = DSP::Float(M_LN10);
-  const DSP::Float M_PIf        = DSP::Float(M_PI);
-  const DSP::Float M_PI_2f      = DSP::Float(M_PI_2);
-  const DSP::Float M_PI_4f      = DSP::Float(M_PI_4);
-  const DSP::Float M_1_PIf      = DSP::Float(M_1_PI);
-  const DSP::Float M_2_PIf      = DSP::Float(M_2_PI);
-  const DSP::Float M_2_SQRTPIf  = DSP::Float(M_2_SQRTPI);
-  const DSP::Float M_SQRT2f     = DSP::Float(M_SQRT2);
-  const DSP::Float M_SQRT1_2f   = DSP::Float(M_SQRT1_2);
+  // M_Ef and similar conflitc with _GNU_SOURCE & __USE_GNU defines
+  const DSP::Float M_E_f         = DSP::Float(M_E);
+  const DSP::Float M_LOG2E_f     = DSP::Float(M_LOG2E);
+  const DSP::Float M_LOG10E_f    = DSP::Float(M_LOG10E);
+  const DSP::Float M_LN2_f       = DSP::Float(M_LN2);
+  const DSP::Float M_LN10_f      = DSP::Float(M_LN10);
+  const DSP::Float M_PI_f        = DSP::Float(M_PI);
+  const DSP::Float M_PI_2_f      = DSP::Float(M_PI_2);
+  const DSP::Float M_PI_4_f      = DSP::Float(M_PI_4);
+  const DSP::Float M_1_PI_f      = DSP::Float(M_1_PI);
+  const DSP::Float M_2_PI_f      = DSP::Float(M_2_PI);
+  const DSP::Float M_2_SQRTPI_f  = DSP::Float(M_2_SQRTPI);
+  const DSP::Float M_SQRT2_f     = DSP::Float(M_SQRT2);
+  const DSP::Float M_SQRT1_2_f   = DSP::Float(M_SQRT1_2);
 
   const DSP::Float M_PIx2 = DSP::Float(M_PIx2_prec);
   const DSP::Float M_PIx1 = DSP::Float(M_PIx1_prec);
-- 
GitLab