Qt v5.15 compatibility

This commit is contained in:
Bill Somerville
2020-06-13 16:04:41 +01:00
parent 4476c0e736
commit 9c22b5c3ed
27 changed files with 459 additions and 150 deletions
+9
View File
@@ -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)