Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
7afc61ae
Commit
7afc61ae
authored
Oct 06, 2009
by
malosek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0MQ compilable on winXP mingw with --with-pgm2 option
parent
ac83175e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
41 deletions
+86
-41
configure.in
configure.in
+9
-3
Makefile.am
src/Makefile.am
+34
-19
pgm_receiver.cpp
src/pgm_receiver.cpp
+5
-0
pgm_receiver.hpp
src/pgm_receiver.hpp
+7
-1
pgm_sender.cpp
src/pgm_sender.cpp
+4
-2
pgm_sender.hpp
src/pgm_sender.hpp
+4
-0
pgm_socket.cpp
src/pgm_socket.cpp
+15
-8
pgm_socket.hpp
src/pgm_socket.hpp
+5
-8
platform.hpp.in
src/platform.hpp.in
+3
-0
No files found.
configure.in
View file @
7afc61ae
...
...
@@ -43,6 +43,9 @@ pedantic="yes"
#By default compiling with -Werror except OSX.
werror="yes"
#Whether we are on mingw or not.
on_mingw32="no"
# Host speciffic checks
AC_CANONICAL_HOST
...
...
@@ -125,8 +128,11 @@ case "${host_os}" in
AC_CHECK_HEADERS(windows.h)
AC_CHECK_LIB(Rpcrt4, main, ,
[AC_MSG_ERROR([Could not link with Rpcrt4.dll.])])
AC_CHECK_LIB(Iphlpapi, main, ,
[AC_MSG_ERROR([Could not link with Iphlpapi.dll.])])
LIBS="${LIBS} -lwsock32 -lws2_32"
CFLAGS="${CFLAGS} -std=c99"
on_mingw32="yes"
;;
*)
AC_MSG_ERROR([Not supported os: $host.])
...
...
@@ -393,8 +399,6 @@ if test "x$with_pgm1_ext" != "xno"; then
*linux*)
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} -Wno-variadic-macros -Wno-long-long "
;;
*solaris*)
;;
*)
AC_MSG_ERROR([PGM extesion is not supported on this platform $host.])
;;
...
...
@@ -487,7 +491,8 @@ if test "x$with_pgm2_ext" != "xno"; then
*linux*)
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} -Wno-variadic-macros -Wno-long-long "
;;
*solaris*)
*mingw32*)
LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_EXTRA_CXXFLAGS} -Wno-variadic-macros -Wno-long-long "
;;
*)
AC_MSG_ERROR([PGM extesion is not supported on this platform $host.])
...
...
@@ -570,6 +575,7 @@ AM_CONDITIONAL(BUILD_PGM2, test "x$pgm2_ext" = "xyes")
AM_CONDITIONAL(BUILD_NO_PGM, test "x$pgm2_ext" = "xno" -a "x$pgm1_ext" = "xno")
AM_CONDITIONAL(BUILD_FORWARDER, test "x$forwarder" = "xyes")
AM_CONDITIONAL(BUILD_PERF, test "x$perf" = "xyes")
AM_CONDITIONAL(ON_MINGW, test "x$on_mingw32" = "xyes")
AC_SUBST(stdint)
AC_SUBST(inttypes)
...
...
src/Makefile.am
View file @
7afc61ae
...
...
@@ -217,6 +217,39 @@ endif
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
=
\
-D_WIN32_WINNT
=
0x0501
\
-DCONFIG_HAVE_IFR_NETMASK
\
-DCONFIG_BIND_INADDR_ANY
\
-DCONFIG_GALOIS_MUL_LUT
\
-DGETTEXT_PACKAGE
=
'"pgm"'
\
-DG_LOG_DOMAIN
=
'"Pgm"'
else
libpgm_diff_flags
=
\
-D__need_IOV_MAX
\
-DCONFIG_HAVE_PSELECT
\
-DCONFIG_HAVE_POLL
\
-DCONFIG_HAVE_PPOLL
\
-DCONFIG_HAVE_EPOLL
\
-DCONFIG_HAVE_CLOCK_GETTIME
\
-DCONFIG_HAVE_CLOCK_NANOSLEEP
\
-DCONFIG_HAVE_NANOSLEEP
\
-DCONFIG_HAVE_USLEEP
\
-DCONFIG_HAVE_RTC
\
-DCONFIG_HAVE_TSC
\
-DCONFIG_HAVE_IFR_NETMASK
\
-DCONFIG_HAVE_GETIFADDRS
\
-DCONFIG_HAVE_GETHOSTBYNAME2
\
-DCONFIG_HAVE_GETPROTOBYNAME_R
\
-DCONFIG_BIND_INADDR_ANY
\
-DCONFIG_GALOIS_MUL_LUT
\
-DGETTEXT_PACKAGE
=
'"pgm"'
\
-DG_LOG_DOMAIN
=
'"Pgm"'
endif
libzmq_la_CFLAGS
=
-I
$(top_srcdir)
/foreign/openpgm/@pgm_basename@/openpgm/pgm/include/ @LIBZMQ_EXTRA_CXXFLAGS@
\
-pipe
\
-Wall
\
...
...
@@ -244,25 +277,7 @@ libzmq_la_CFLAGS = -I$(top_srcdir)/foreign/openpgm/@pgm_basename@/openpgm/pgm/in
--param
max-inline-insns-single
=
600
\
-D_REENTRANT
\
-D_GNU_SOURCE
\
-D__need_IOV_MAX
\
-DCONFIG_HAVE_PSELECT
\
-DCONFIG_HAVE_POLL
\
-DCONFIG_HAVE_PPOLL
\
-DCONFIG_HAVE_EPOLL
\
-DCONFIG_HAVE_CLOCK_GETTIME
\
-DCONFIG_HAVE_CLOCK_NANOSLEEP
\
-DCONFIG_HAVE_NANOSLEEP
\
-DCONFIG_HAVE_USLEEP
\
-DCONFIG_HAVE_RTC
\
-DCONFIG_HAVE_TSC
\
-DCONFIG_HAVE_IFR_NETMASK
\
-DCONFIG_HAVE_GETIFADDRS
\
-DCONFIG_HAVE_GETHOSTBYNAME2
\
-DCONFIG_HAVE_GETPROTOBYNAME_R
\
-DCONFIG_BIND_INADDR_ANY
\
-DCONFIG_GALOIS_MUL_LUT
\
-DGETTEXT_PACKAGE
=
'"pgm"'
\
-DG_LOG_DOMAIN
=
'"Pgm"'
${
libpgm_diff_flags
}
endif
if
BUILD_NO_PGM
...
...
src/pgm_receiver.cpp
View file @
7afc61ae
...
...
@@ -21,6 +21,11 @@
#if defined ZMQ_HAVE_OPENPGM
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#include <pgm/pgm.h>
#include <iostream>
#include "pgm_receiver.hpp"
...
...
src/pgm_receiver.hpp
View file @
7afc61ae
...
...
@@ -24,13 +24,19 @@
#if defined ZMQ_HAVE_OPENPGM
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#include <map>
#include <pgm/pgm.h>
#include "io_object.hpp"
#include "i_engine.hpp"
#include "options.hpp"
#include "zmq_decoder.hpp"
#include "pgm_socket.hpp"
#include <map>
namespace
zmq
{
...
...
src/pgm_sender.cpp
View file @
7afc61ae
...
...
@@ -21,6 +21,10 @@
#if defined ZMQ_HAVE_OPENPGM
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#include <iostream>
#include "io_thread.hpp"
...
...
@@ -42,7 +46,6 @@
{ printf (__VA_ARGS__);}} while (0)
#endif
#ifdef ZMQ_HAVE_LINUX
zmq
::
pgm_sender_t
::
pgm_sender_t
(
io_thread_t
*
parent_
,
const
options_t
&
options_
,
const
char
*
session_name_
)
:
io_object_t
(
parent_
),
...
...
@@ -213,4 +216,3 @@ size_t zmq::pgm_sender_t::write_one_pkt_with_offset (unsigned char *data_,
}
#endif
#endif
src/pgm_sender.hpp
View file @
7afc61ae
...
...
@@ -24,6 +24,10 @@
#if defined ZMQ_HAVE_OPENPGM
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#include "stdint.hpp"
#include "io_object.hpp"
#include "i_engine.hpp"
...
...
src/pgm_socket.cpp
View file @
7afc61ae
...
...
@@ -21,13 +21,17 @@
#ifdef ZMQ_HAVE_OPENPGM
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#ifdef ZMQ_HAVE_LINUX
// TODO: needed for pgm - add this into platform.hpp?
#include <poll.h>
// Has to be defined befiore including pgm/pgm.h
#define CONFIG_HAVE_POLL
#include <pgm/pgm.h>
#endif
#include <pgm/pgm.h>
#include <string>
#include <iostream>
...
...
@@ -51,8 +55,6 @@
{ printf (__VA_ARGS__);}} while (0)
#endif
#ifdef ZMQ_HAVE_LINUX
zmq
::
pgm_socket_t
::
pgm_socket_t
(
bool
receiver_
,
const
options_t
&
options_
)
:
g_transport
(
NULL
),
options
(
options_
),
...
...
@@ -480,7 +482,9 @@ void zmq::pgm_socket_t::close_transport (void)
int
zmq
::
pgm_socket_t
::
get_receiver_fds
(
int
*
recv_fd_
,
int
*
waiting_pipe_fd_
)
{
#ifdef ZMQ_HAVE_WINDOWS
zmq_assert
(
false
);
#else
// For POLLIN there are 2 pollfds in pgm_transport.
int
fds_array_size
=
pgm_receiver_fd_count
;
pollfd
*
fds
=
new
pollfd
[
fds_array_size
];
...
...
@@ -500,7 +504,7 @@ int zmq::pgm_socket_t::get_receiver_fds (int *recv_fd_,
*
waiting_pipe_fd_
=
fds
[
1
].
fd
;
delete
[]
fds
;
#endif
return
pgm_receiver_fd_count
;
}
...
...
@@ -520,6 +524,9 @@ int zmq::pgm_socket_t::get_sender_fds (int *send_fd_, int *receive_fd_,
zmq_assert
(
rdata_notify_fd_
);
#endif
#ifdef ZMQ_HAVE_WINDOWS
zmq_assert
(
false
);
#else
// Preallocate pollfds array.
int
fds_array_size
=
pgm_sender_fd_count
;
pollfd
*
fds
=
new
pollfd
[
fds_array_size
];
...
...
@@ -546,6 +553,7 @@ int zmq::pgm_socket_t::get_sender_fds (int *send_fd_, int *receive_fd_,
#endif
delete
[]
fds
;
#endif
return
pgm_sender_fd_count
;
}
...
...
@@ -855,4 +863,3 @@ void zmq::pgm_socket_t::process_upstream (void)
#endif
#endif
src/pgm_socket.hpp
View file @
7afc61ae
...
...
@@ -24,13 +24,12 @@
#if defined ZMQ_HAVE_OPENPGM
#ifdef ZMQ_HAVE_LINUX
#include <glib.h>
#include <pgm/pgm.h>
#else
#include <Winsock2.h>
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#include <pgm/pgm.h>
#include "stdint.hpp"
#include "options.hpp"
...
...
@@ -40,8 +39,6 @@ namespace zmq
class
pgm_socket_t
{
#ifdef ZMQ_HAVE_LINUX
public
:
// If receiver_ is true PGM transport is not generating SPM packets.
// interface format: iface;mcast_group:port for raw PGM socket
...
...
@@ -148,9 +145,9 @@ namespace zmq
// Receiver transport uses 2 fd.
enum
{
pgm_receiver_fd_count
=
2
};
#endif
};
}
#endif
#endif
src/platform.hpp.in
View file @
7afc61ae
...
...
@@ -24,6 +24,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `Iphlpapi' library (-lIphlpapi). */
#undef HAVE_LIBIPHLPAPI
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment