summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2010-01-28 12:45:37 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2010-01-28 12:45:37 +0100
commit849095a042b8326f5789baa04d1dbb7ca36d4632 (patch)
tree2974bc9f9f14c67059d45be0a6932b263930506a /src
parentf17f0fa67bc5a373f3fc7964aaad4f08aa1dc761 (diff)
parente5ff617c4e061d29c9a019efa2292fd09c87a71e (diff)
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am14
-rw-r--r--src/pgm_socket.cpp25
-rw-r--r--src/windows.hpp4
3 files changed, 35 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bd6748a..6957ff0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,7 +46,8 @@ pgm_sources = ../foreign/openpgm/@pgm_basename@/openpgm/pgm/packet.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/wsastrerror.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/glib-compat.c \
../foreign/openpgm/@pgm_basename@/openpgm/pgm/backtrace.c \
- ../foreign/openpgm/@pgm_basename@/openpgm/pgm/log.c
+ ../foreign/openpgm/@pgm_basename@/openpgm/pgm/log.c \
+ ../foreign/openpgm/@pgm_basename@/openpgm/pgm/sockaddr.c
endif
nodist_libzmq_la_SOURCES = $(pgm_sources)
@@ -170,7 +171,6 @@ libzmq_la_SOURCES = app_thread.hpp \
libzmq_la_LDFLAGS = -version-info @LTVER@ @LIBZMQ_EXTRA_LDFLAFS@
if BUILD_PGM2
-libzmq_la_CXXFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ -Wall @LIBZMQ_EXTRA_CXXFLAGS@
if ON_MINGW
libpgm_diff_flags = \
@@ -179,6 +179,8 @@ libpgm_diff_flags = \
-DCONFIG_BIND_INADDR_ANY \
-DCONFIG_GALOIS_MUL_LUT \
-DIF_NAMESIZE=256 \
+ -DPGM_GNUC_INTERNAL=G_GNUC_INTERNAL \
+ -DCONFIG_HAVE_WSACMSGHDR \
-DGETTEXT_PACKAGE='"pgm"' \
-DG_LOG_DOMAIN='"Pgm"'
@@ -201,6 +203,11 @@ libpgm_diff_flags = \
-DCONFIG_HAVE_GETPROTOBYNAME_R \
-DCONFIG_BIND_INADDR_ANY \
-DCONFIG_GALOIS_MUL_LUT \
+ -DCONFIG_HAVE_MCAST_JOIN \
+ -DCONFIG_HAVE_IP_MREQN \
+ -DCONFIG_HAVE_SPRINTF_GROUPING \
+ -DCONFIG_HAVE_HPET \
+ -DPGM_GNUC_INTERNAL=G_GNUC_INTERNAL \
-DGETTEXT_PACKAGE='"pgm"' \
-DG_LOG_DOMAIN='"Pgm"'
endif
@@ -233,6 +240,9 @@ libzmq_la_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/in
-D_REENTRANT \
-D_GNU_SOURCE \
${libpgm_diff_flags}
+
+libzmq_la_CXXFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ \
+ -Wall @LIBZMQ_EXTRA_CXXFLAGS@ ${libpgm_diff_flags}
endif
if BUILD_NO_PGM
diff --git a/src/pgm_socket.cpp b/src/pgm_socket.cpp
index 11084ff..4d713e3 100644
--- a/src/pgm_socket.cpp
+++ b/src/pgm_socket.cpp
@@ -27,8 +27,6 @@
#ifdef ZMQ_HAVE_LINUX
#include <poll.h>
-// Has to be defined befiore including pgm/pgm.h
-#define CONFIG_HAVE_POLL
#endif
#include <stdlib.h>
@@ -88,10 +86,25 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_)
// Note that if you want to use gettimeofday and sleep for openPGM timing,
// set environment variables PGM_TIMER to "GTOD"
// and PGM_SLEEP to "USLEEP".
- int rc = pgm_init ();
- if (rc != 0) {
- errno = EINVAL;
- return -1;
+ int rc = pgm_init (&pgm_error);
+ if (rc != TRUE) {
+
+ if (pgm_error->domain == PGM_IF_ERROR && (
+ pgm_error->code == PGM_IF_ERROR_INVAL ||
+ pgm_error->code == PGM_IF_ERROR_XDEV ||
+ pgm_error->code == PGM_IF_ERROR_NODEV ||
+ pgm_error->code == PGM_IF_ERROR_NOTUNIQ ||
+ pgm_error->code == PGM_IF_ERROR_ADDRFAMILY ||
+ pgm_error->code == PGM_IF_ERROR_FAMILY ||
+ pgm_error->code == PGM_IF_ERROR_NODATA ||
+ pgm_error->code == PGM_IF_ERROR_NONAME ||
+ pgm_error->code == PGM_IF_ERROR_SERVICE)) {
+ errno = EINVAL;
+ g_error_free (pgm_error);
+ return -1;
+ }
+
+ zmq_assert (false);
}
// PGM transport GSI.
diff --git a/src/windows.hpp b/src/windows.hpp
index 7cb9291..81c4d38 100644
--- a/src/windows.hpp
+++ b/src/windows.hpp
@@ -65,4 +65,8 @@
#include <ipexport.h>
#include <process.h>
+// On mingw environment AI_NUMERICSERV is not defined, needed in ip.cpp.
+#ifndef AI_NUMERICSERV
+#define AI_NUMERICSERV 0x0400
+#endif
#endif