summaryrefslogtreecommitdiff
path: root/gr-fec
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2014-07-08 07:22:36 -0700
committerNicholas Corgan <nick.corgan@ettus.com>2014-07-08 07:26:36 -0700
commitb5006c14e4351d32d033fa13a17925e83ba6a0f6 (patch)
tree186024d7b6e8a3d926f3103df6220e1e6432ff28 /gr-fec
parent3d6dc9c0ddb34d923b55a300bdd1356ce5b9a654 (diff)
Windows compatibility fixes
* fec/ber_tools: added include and #define necessary to use M_PI * qtgui: changed erfc to boost::math::erfc * volk: don't try to align with MSVC
Diffstat (limited to 'gr-fec')
-rw-r--r--gr-fec/lib/ber_tools.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gr-fec/lib/ber_tools.cc b/gr-fec/lib/ber_tools.cc
index 675932a690..043fbef216 100644
--- a/gr-fec/lib/ber_tools.cc
+++ b/gr-fec/lib/ber_tools.cc
@@ -20,6 +20,12 @@
* Boston, MA 02110-1301, USA.
*/
+#include <cstdlib>
+#ifdef _MSC_VER
+#define _USE_MATH_DEFINES
+#include <cmath>
+#endif
+
#include "ber_tools.h"
inline int
@@ -35,8 +41,13 @@ gaussnoise(float *inbuffer, int buffsize, float sigma)
float udrn1=0.0, udrn2=0.0, noise=0.0;
for(i = 0; i < buffsize;i++) {
+ #ifdef _MSC_VER
+ while((udrn1 = (float)(std::rand())) < 0.0000001);
+ udrn2 = (float)(std::rand());
+ #else
while((udrn1 = (float)drand48()) < 0.0000001);
udrn2 = (float)drand48();
+ #endif
noise = sigma*sqrt(-2*log(udrn1))*cos(2*M_PI*udrn2);
inbuffer[i] += noise;
}