Windows: MSVC2017: changes in qrtplib

This commit is contained in:
f4exb 2018-11-12 16:05:18 +01:00
parent cdacf51bfb
commit f97728c4e9
5 changed files with 20 additions and 4 deletions

View File

@ -84,7 +84,11 @@
// No SRTP support
#ifdef _MSC_VER
#define RTP_HAVE_QUERYPERFORMANCECOUNTER
#else
#define RTP_HAVE_CLOCK_GETTIME
#endif
#define RTP_HAVE_POLL

View File

@ -40,7 +40,11 @@
#include "rtprandomrand48.h"
#include <time.h>
#ifdef _MSC_VER
#include "Windows.h"
#else
#include <unistd.h>
#endif
#include <QDateTime>
@ -50,7 +54,11 @@ namespace qrtplib
uint32_t RTPRandom::PickSeed()
{
uint32_t x;
#ifdef _MSC_VER
x = GetCurrentProcessId();
#else
x = (uint32_t) getpid();
#endif
QDateTime currentDateTime = QDateTime::currentDateTime();
x += currentDateTime.toTime_t();
#if defined(WIN32)

View File

@ -49,7 +49,6 @@
#endif // RTP_SUPPORT_SENDAPP
#include "rtpinternalutils.h"
#include <unistd.h>
#include <stdlib.h>
#include <QHostInfo>
@ -1143,8 +1142,9 @@ int RTPSession::ProcessPolledData()
return 0;
}
int RTPSession::CreateCNAME(uint8_t *buffer, std::size_t *bufferlength, bool resolve __attribute__((unused)))
int RTPSession::CreateCNAME(uint8_t *buffer, std::size_t *bufferlength, bool resolve)
{
(void) resolve;
buffer[*bufferlength - 1] = 0;
std::size_t offset = strlen((const char *) buffer);

View File

@ -67,13 +67,15 @@ RTPSessionParams::RTPSessionParams() :
predefinedssrc = 0;
}
int RTPSessionParams::SetUsePollThread(bool usethread __attribute__((unused)))
int RTPSessionParams::SetUsePollThread(bool usethread)
{
(void) usethread;
return ERR_RTP_NOTHREADSUPPORT;
}
int RTPSessionParams::SetNeedThreadSafety(bool __attribute__((unused)))
int RTPSessionParams::SetNeedThreadSafety(bool x)
{
(void) x;
return ERR_RTP_NOTHREADSUPPORT;
}

View File

@ -44,6 +44,8 @@
#include <sys/time.h>
#include <time.h>
#include <errno.h>
#else
#include "Windows.h"
#endif // RTP_HAVE_QUERYPERFORMANCECOUNTER
#include "export.h"