From 72d83643708ba0cde3c207bd63b3149b498e55a1 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 7 Oct 2018 14:03:27 +0200 Subject: [PATCH] libresapi fix compile error on windows due to time_t usage --- libresapi/src/api/ChatHandler.cpp | 8 ++++---- libresapi/src/api/ChatHandler.h | 3 ++- libresapi/src/api/IdentityHandler.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libresapi/src/api/ChatHandler.cpp b/libresapi/src/api/ChatHandler.cpp index b7917eb19..a266a8540 100644 --- a/libresapi/src/api/ChatHandler.cpp +++ b/libresapi/src/api/ChatHandler.cpp @@ -132,8 +132,8 @@ public: SendLobbyParticipantsTask(RsIdentity* idservice, ChatHandler::LobbyParticipantsInfo pi): GxsResponseTask(idservice, 0), mParticipantsInfo(pi) { - const std::map& map = mParticipantsInfo.participants; - for(std::map::const_iterator mit = map.begin(); mit != map.end(); ++mit) + const auto& map = mParticipantsInfo.participants; + for(auto mit = map.begin(); mit != map.end(); ++mit) { requestGxsId(mit->first); } @@ -144,8 +144,8 @@ protected: virtual void gxsDoWork(Request &/*req*/, Response &resp) { resp.mDataStream.getStreamToMember(); - const std::map& map = mParticipantsInfo.participants; - for(std::map::const_iterator mit = map.begin(); mit != map.end(); ++mit) + const auto& map = mParticipantsInfo.participants; + for(auto mit = map.begin(); mit != map.end(); ++mit) { StreamBase& stream = resp.mDataStream.getStreamToMember(); double last_active = mit->second; diff --git a/libresapi/src/api/ChatHandler.h b/libresapi/src/api/ChatHandler.h index d635c02dc..57b227a0c 100644 --- a/libresapi/src/api/ChatHandler.h +++ b/libresapi/src/api/ChatHandler.h @@ -26,6 +26,7 @@ #include "StateTokenServer.h" #include #include +#include "util/rstime.h" class RsPeers; class RsIdentity; @@ -117,7 +118,7 @@ public: class LobbyParticipantsInfo{ public: StateToken state_token; - std::map participants; + std::map participants; }; class ChatInfo{ diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp index 9e7228759..71c2c79b4 100644 --- a/libresapi/src/api/IdentityHandler.cpp +++ b/libresapi/src/api/IdentityHandler.cpp @@ -521,7 +521,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp) StreamBase& usagesStream = resp.mDataStream.getStreamToMember("usages"); usagesStream.getStreamToMember(); - for(std::map::const_iterator it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it) + for(auto it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it) { usagesStream.getStreamToMember() << makeKeyValue("usage_time", (uint32_t)data.mLastUsageTS)