diff options
| author | Christoph Berg <christoph.berg@credativ.de> | 2020-06-26 09:28:37 +0200 |
|---|---|---|
| committer | Christoph Berg <christoph.berg@credativ.de> | 2020-06-26 11:49:13 +0200 |
| commit | 9990285acbfa40ec4478d46d9f542d227126239b (patch) | |
| tree | d8f012d37c627d3d6a821bfb3be98c3e30c17718 /getfile.cpp | |
| parent | 0e845413c25b8eddc8d6d701b9b6c5af29b2bde8 (diff) | |
New upstream version 2.2.2+repack
Diffstat (limited to 'getfile.cpp')
| -rw-r--r-- | getfile.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/getfile.cpp b/getfile.cpp index b59a094a..8cc6cedc 100644 --- a/getfile.cpp +++ b/getfile.cpp @@ -1,5 +1,9 @@ #include "getfile.h" #include <QDir> +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) +#include <QRandomGenerator> +#include <random> +#endif #include <stdlib.h> #include <stdint.h> #include <string.h> @@ -171,6 +175,10 @@ void savewav(QString fname, int ntrperiod) /* Generate gaussian random float with mean=0 and std_dev=1 */ float gran() { +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + static std::normal_distribution<float> d; + return d (*QRandomGenerator::global ()); +#else float fac,rsq,v1,v2; static float gset; static int iset; @@ -192,6 +200,7 @@ float gran() gset = v1*fac; iset++; return v2*fac; +#endif } int ptt(int nport, int ntx, int* iptt, int* nopen) |
