1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-27 04:11:35 +01:00

Fix compilation warnings

This commit is contained in:
Matias Fontanini
2016-02-21 18:50:47 -08:00
parent 5920185288
commit e5282f8a3c
3 changed files with 12 additions and 4 deletions

View File

@@ -483,9 +483,17 @@ PDU* PacketSender::recv_match_loop(const vector<int>& sockets,
if (now > end) {
return 0;
}
// VC complains if we don't statically cast here
#ifdef _WIN32
typedef long tv_sec_type;
typedef long tv_usec_type;
#else
typedef time_t tv_sec_type;
typedef long tv_usec_type;
#endif
microseconds diff = end - now;
timeout.tv_sec = duration_cast<seconds>(diff).count();
timeout.tv_usec = (diff - seconds(timeout.tv_sec)).count();
timeout.tv_sec = static_cast<tv_sec_type>(duration_cast<seconds>(diff).count());
timeout.tv_usec = static_cast<tv_usec_type>((diff - seconds(timeout.tv_sec)).count());
#else
#ifdef _WIN32
// Can't do much