summaryrefslogtreecommitdiff
path: root/src/err.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-09-02 10:23:01 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-09-02 10:23:01 +0200
commit5e08a89d1c0edf44e15f262dd0f27a1c03bcd699 (patch)
treeeba28221c1e5e69418078df406609e8d3dffe64c /src/err.hpp
parent6a5120b1f1c48d19b777f76ac756b00fb624d110 (diff)
parent1f06d99a0f563fdc32e9c00392f9875ba3009593 (diff)
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'src/err.hpp')
-rw-r--r--src/err.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/err.hpp b/src/err.hpp
index 3854d8a..c1b2916 100644
--- a/src/err.hpp
+++ b/src/err.hpp
@@ -22,6 +22,7 @@
#include <assert.h>
#include <errno.h>
+#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -81,10 +82,10 @@ namespace zmq
}} 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)
+#define posix_assert(x) do { if ((x)) {\
+ 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) {\