From f97728c4e95ca0a04aaaf7bbf31b88bd61000b65 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 12 Nov 2018 16:05:18 +0100 Subject: [PATCH] Windows: MSVC2017: changes in qrtplib --- qrtplib/rtpconfig.h | 4 ++++ qrtplib/rtprandom.cpp | 8 ++++++++ qrtplib/rtpsession.cpp | 4 ++-- qrtplib/rtpsessionparams.cpp | 6 ++++-- qrtplib/rtptimeutilities.h | 2 ++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/qrtplib/rtpconfig.h b/qrtplib/rtpconfig.h index faf4e6e2f..c69114266 100644 --- a/qrtplib/rtpconfig.h +++ b/qrtplib/rtpconfig.h @@ -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 diff --git a/qrtplib/rtprandom.cpp b/qrtplib/rtprandom.cpp index 5fbb5562f..e5764714c 100644 --- a/qrtplib/rtprandom.cpp +++ b/qrtplib/rtprandom.cpp @@ -40,7 +40,11 @@ #include "rtprandomrand48.h" #include +#ifdef _MSC_VER +#include "Windows.h" +#else #include +#endif #include @@ -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) diff --git a/qrtplib/rtpsession.cpp b/qrtplib/rtpsession.cpp index a9d42a8d2..1740409d0 100644 --- a/qrtplib/rtpsession.cpp +++ b/qrtplib/rtpsession.cpp @@ -49,7 +49,6 @@ #endif // RTP_SUPPORT_SENDAPP #include "rtpinternalutils.h" -#include #include #include @@ -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); diff --git a/qrtplib/rtpsessionparams.cpp b/qrtplib/rtpsessionparams.cpp index 40b611899..916c49852 100644 --- a/qrtplib/rtpsessionparams.cpp +++ b/qrtplib/rtpsessionparams.cpp @@ -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; } diff --git a/qrtplib/rtptimeutilities.h b/qrtplib/rtptimeutilities.h index 7252bb7ba..526141777 100644 --- a/qrtplib/rtptimeutilities.h +++ b/qrtplib/rtptimeutilities.h @@ -44,6 +44,8 @@ #include #include #include +#else +#include "Windows.h" #endif // RTP_HAVE_QUERYPERFORMANCECOUNTER #include "export.h"