summaryrefslogtreecommitdiff
path: root/src/err.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/err.hpp')
-rw-r--r--src/err.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/err.hpp b/src/err.hpp
index fdfce01..3854d8a 100644
--- a/src/err.hpp
+++ b/src/err.hpp
@@ -80,6 +80,12 @@ namespace zmq
abort ();\
}} while (false)
+// Provides convenient way to check for POSIX errors.
+#define posix_assert(x) do {\
+fprintf (stderr, "%s (%s:%d)\n", strerror (x), __FILE__, __LINE__);\
+abort ();\
+} while (false)
+
// Provides convenient way to check for errors from getaddrinfo.
#define gai_assert(x) do { if (x) {\
const char *errstr = gai_strerror (x);\