From 16c3884a61b146040277ec61bfdbc553c883b4d6 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 27 Sep 2010 11:18:21 +0200 Subject: MSVC build fixed --- src/clock.cpp | 2 +- src/ctx.cpp | 6 ++++++ src/select.cpp | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/clock.cpp b/src/clock.cpp index 736748d..8eb5fd8 100644 --- a/src/clock.cpp +++ b/src/clock.cpp @@ -89,7 +89,7 @@ uint64_t zmq::clock_t::now_ms () uint64_t zmq::clock_t::rdtsc () { #if (defined _MSC_VER && (defined _M_IX86 || defined _M_X64)) - uint64_t current_time = __rdtsc (); + return __rdtsc (); #elif (defined __GNUC__ && (defined __i386__ || defined __x86_64__)) uint32_t low, high; __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high)); diff --git a/src/ctx.cpp b/src/ctx.cpp index 7ed924d..eb4b412 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -316,7 +316,13 @@ void zmq::ctx_t::dezombify () for (zombies_t::iterator it = zombies.begin (); it != zombies.end ();) { uint32_t slot = (*it)->get_slot (); if ((*it)->dezombify ()) { +#if defined _MSC_VER + + // HP implementation of STL requires doing it this way... + it = zombies.erase (it); +#else zombies.erase (it); +#endif empty_slots.push_back (slot); slots [slot] = NULL; } diff --git a/src/select.cpp b/src/select.cpp index f6e5133..ae2ffe2 100644 --- a/src/select.cpp +++ b/src/select.cpp @@ -156,7 +156,8 @@ void zmq::select_t::loop () uint64_t timeout = execute_timers (); // Wait for events. - struct timeval tv = {timeout / 1000, timeout % 1000 * 1000}; + struct timeval tv = {(long) (timeout / 1000), + (long) (timeout % 1000 * 1000)}; int rc = select (maxfd + 1, &readfds, &writefds, &exceptfds, timeout ? &tv : NULL); -- cgit v1.2.3