diff options
author | Ghislain Putois <ghpu@infonie.fr> | 2011-08-15 19:39:21 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-08-15 19:39:21 +0200 |
commit | 85851d312771f043263257bcf972bd11cadec50a (patch) | |
tree | 71ac412f2fcaa1d822e15094615a7beabeb697b4 | |
parent | 0354d4d37fe814b9dbb94415da2c5314c4b68ae6 (diff) |
Preliminary Android support
Some small changes to prepare a cross-compilation for the Android platform
Signed-off-by: Ghislain Putois <ghpu@infonie.fr>
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | src/ip.cpp | 7 | ||||
-rw-r--r-- | src/thread.cpp | 6 |
3 files changed, 8 insertions, 6 deletions
@@ -27,6 +27,7 @@ Fabien Ninoles <fabien@tzone.org> Frank Denis <zeromq@pureftpd.org> George Neill <georgen@neillnet.com> Gerard Toonstra <gtoonstra@gmail.com> +Ghislain Putois <ghpu@infonie.fr> Gonzalo Diethelm <gdiethelm@dcv.cl> Guido Goldstein <zmq@a-nugget.de> Ilja Golshtein <ilejncs@narod.ru> @@ -106,7 +106,7 @@ static int resolve_nic_name (struct sockaddr* addr_, char const *interface_, return 0; } -#elif defined ZMQ_HAVE_AIX || ZMQ_HAVE_HPUX +#elif defined ZMQ_HAVE_AIX || ZMQ_HAVE_HPUX || ZMQ_HAVE_ANDROID #include <sys/types.h> #include <unistd.h> @@ -139,8 +139,9 @@ static int resolve_nic_name (struct sockaddr* addr_, char const *interface_, return -1; } - struct sockaddr *sa = (struct sockaddr *) &ifr.ifr_addr; - *addr_ = ((sockaddr_in*)sa)->sin_addr; + memcpy (&((sockaddr_in*) addr_)->sin_addr, + &((sockaddr_in*) &ifr.ifr_addr)->sin_addr, sizeof (in_addr)); + return 0; } diff --git a/src/thread.cpp b/src/thread.cpp index 06a47fc..d1c6729 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -59,15 +59,15 @@ extern "C" { static void *thread_routine (void *arg_) { - #if !defined ZMQ_HAVE_OPENVMS - // Following code will guarantee more predictable latecnies as it'll +#if !defined ZMQ_HAVE_OPENVMS && !defined ZMQ_HAVE_ANDROID + // Following code will guarantee more predictable latencies as it'll // disallow any signal handling in the I/O thread. sigset_t signal_set; int rc = sigfillset (&signal_set); errno_assert (rc == 0); rc = pthread_sigmask (SIG_BLOCK, &signal_set, NULL); posix_assert (rc); - #endif +#endif zmq::thread_t *self = (zmq::thread_t*) arg_; self->tfn (self->arg); |