summaryrefslogtreecommitdiff
path: root/src/err.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-05-08 09:03:49 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-05-08 09:03:49 +0200
commit49387874efe790713f4a090e03a97212f4889163 (patch)
tree8f95a07b3529892e6512061b35f8d963927c1c68 /src/err.hpp
parentda1ef4d2685c02e8320847d49a38726b2b6d52f0 (diff)
Async connect doesn't fail on EWSANETDOWN
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/err.hpp')
-rw-r--r--src/err.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/err.hpp b/src/err.hpp
index 6289a08..9558a10 100644
--- a/src/err.hpp
+++ b/src/err.hpp
@@ -49,6 +49,7 @@ namespace zmq
namespace zmq
{
const char *wsa_error ();
+ const char *wsa_error_no (int no_);
void win_error (char *buffer_, size_t buffer_size_);
void wsa_error_to_errno ();
}
@@ -66,6 +67,17 @@ namespace zmq
}\
} while (false)
+// Provides convenient way to assert on WSA-style errors on Windows.
+#define wsa_assert_no(no) \
+ do {\
+ const char *errstr = zmq::wsa_error_no (no);\
+ if (errstr != NULL) {\
+ fprintf (stderr, "Assertion failed: %s (%s:%d)\n", errstr, \
+ __FILE__, __LINE__);\
+ abort ();\
+ }\
+ } while (false)
+
// Provides convenient way to check GetLastError-style errors on Windows.
#define win_assert(x) \
do {\