diff options
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) |
