summaryrefslogtreecommitdiff
path: root/src/err.hpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-01-23 08:53:57 +0100
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:57 +0100
commitb593ea30833ad5dcacb9076c988aec31b0cf26ec (patch)
tree3d0c6f1dadfa2d947cf23f6109bb27b01ab202af /src/err.hpp
parentcbaa7cfa93893876e4fd8794b6ea39f4d245b6b5 (diff)
Imported Upstream version 2.1.7upstream/2.1.7
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 3ffd99d..b540a5d 100644
--- a/src/err.hpp
+++ b/src/err.hpp
@@ -46,6 +46,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 ();
}
@@ -63,6 +64,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 {\