summaryrefslogtreecommitdiff
path: root/bindings/c
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.com>2009-09-22 12:08:18 +0200
committerMartin Sustrik <sustrik@fastmq.com>2009-09-22 12:08:18 +0200
commita0db7f6b811e687eda452a7de9f5db112f715544 (patch)
treebb4e2ef6e77b3348373f826eb8c99d406cdb06c8 /bindings/c
parente136d923b7060ef64d44264f88e49057e6638f31 (diff)
POSIX error codes unsupported on win platform faked
Diffstat (limited to 'bindings/c')
-rw-r--r--bindings/c/zmq.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/bindings/c/zmq.h b/bindings/c/zmq.h
index 3931039..056d89a 100644
--- a/bindings/c/zmq.h
+++ b/bindings/c/zmq.h
@@ -24,6 +24,7 @@
extern "C" {
#endif
+#include <errno.h>
#include <stddef.h>
// Microsoft Visual Studio uses non-standard way to export/import symbols.
@@ -43,9 +44,18 @@ extern "C" {
// different OSes. The assumption is that error_t is at least 32-bit type.
#define ZMQ_HAUSNUMERO 156384712
-#define EMTHREAD (ZMQ_HAUSNUMERO + 1)
-#define EFSM (ZMQ_HAUSNUMERO + 2)
-#define ENOCOMPATPROTO (ZMQ_HAUSNUMERO + 3)
+// On Windows platform some of the standard POSIX errnos are not defined.
+#ifndef ENOTSUP
+#define ENOTSUP (ZMQ_HAUSNUMERO + 1)
+#endif
+#ifndef EPROTONOSUPPORT
+#define EPROTONOSUPPORT (ZMQ_HAUSNUMERO + 2)
+#endif
+
+// Native 0MQ error codes.
+#define EMTHREAD (ZMQ_HAUSNUMERO + 50)
+#define EFSM (ZMQ_HAUSNUMERO + 51)
+#define ENOCOMPATPROTO (ZMQ_HAUSNUMERO + 52)
// Resolves system errors and 0MQ errors to human-readable string.
ZMQ_EXPORT const char *zmq_strerror (int errnum);