summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-27 11:18:21 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-27 11:18:21 +0200
commit16c3884a61b146040277ec61bfdbc553c883b4d6 (patch)
tree1de5c53f9a02124409f7c615c8921792de652166
parente2f834d2947ad7e7f4e6bfb5be653af8b8a2a576 (diff)
MSVC build fixed
-rw-r--r--builds/msvc/libzmq/libzmq.vcproj42
-rw-r--r--src/clock.cpp2
-rw-r--r--src/ctx.cpp6
-rw-r--r--src/select.cpp3
4 files changed, 46 insertions, 7 deletions
diff --git a/builds/msvc/libzmq/libzmq.vcproj b/builds/msvc/libzmq/libzmq.vcproj
index c7b256a..ffe8a17 100644
--- a/builds/msvc/libzmq/libzmq.vcproj
+++ b/builds/msvc/libzmq/libzmq.vcproj
@@ -170,6 +170,10 @@
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
+ RelativePath="..\..\..\src\clock.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\command.cpp"
>
</File>
@@ -270,6 +274,10 @@
>
</File>
<File
+ RelativePath="..\..\..\src\poller_base.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\pub.cpp"
>
</File>
@@ -384,6 +392,10 @@
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
+ RelativePath="..\..\..\src\array.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\atomic_counter.hpp"
>
</File>
@@ -392,6 +404,14 @@
>
</File>
<File
+ RelativePath="..\..\..\src\blob.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\clock.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\command.hpp"
>
</File>
@@ -440,10 +460,6 @@
>
</File>
<File
- RelativePath="..\..\..\src\i_endpoint.hpp"
- >
- </File>
- <File
RelativePath="..\..\..\src\i_engine.hpp"
>
</File>
@@ -476,6 +492,10 @@
>
</File>
<File
+ RelativePath="..\..\..\src\likely.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\msg_content.hpp"
>
</File>
@@ -520,7 +540,7 @@
>
</File>
<File
- RelativePath="..\platform.hpp"
+ RelativePath="..\..\..\src\platform.hpp"
>
</File>
<File
@@ -528,6 +548,14 @@
>
</File>
<File
+ RelativePath="..\..\..\src\poller.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\src\poller_base.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\pub.hpp"
>
</File>
@@ -556,6 +584,10 @@
>
</File>
<File
+ RelativePath="..\..\..\src\semaphore.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\session.hpp"
>
</File>
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);