summaryrefslogtreecommitdiff
path: root/src/err.hpp
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2011-05-13 12:43:09 +0200
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:59 +0100
commitad3e013f74d309b86e8f087932203e5787fe2d2d (patch)
treea872da7e7338a0bb27b92ef1f198689873b86978 /src/err.hpp
parentf34d1599a651dd0b8feba2397f87629733988384 (diff)
parentb593ea30833ad5dcacb9076c988aec31b0cf26ec (diff)
Imported Debian patch 2.1.7-1debian/2.1.7-1
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 {\