From 43e377c08e253bf570601b9ed01753356d18de49 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Thu, 5 Apr 2007 09:31:38 +0000 Subject: [PATCH] Fix AIX problem, based on patch from Michael Augustin . --- src/libssh2_priv.h | 24 ++++++++++++++++++++++++ src/packet.c | 14 -------------- src/session.c | 15 --------------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h index 6843e95..cbf2f53 100644 --- a/src/libssh2_priv.h +++ b/src/libssh2_priv.h @@ -40,6 +40,30 @@ #define LIBSSH2_LIBRARY #include "libssh2_config.h" + +/* The following CPP block should really only be in session.c and + packet.c. However, AIX have #define's for 'events' and 'revents' + and we are using those names in libssh2.h, so we need to include + the AIX headers first, to make sure all code is compiled with + consistent names of these fields. While arguable the best would to + change libssh2.h to use other names, that would break backwards + compatibility. For more information, see: + http://www.mail-archive.com/libssh2-devel%40lists.sourceforge.net/msg00003.html + http://www.mail-archive.com/libssh2-devel%40lists.sourceforge.net/msg00224.html +*/ +#ifdef HAVE_POLL +# include +#else +# ifdef HAVE_SELECT +# ifdef HAVE_SYS_SELECT_H +# include +# else +# include +# include +# endif +# endif +#endif + #include "libssh2.h" #include diff --git a/src/packet.c b/src/packet.c index 00e5f50..ae985de 100644 --- a/src/packet.c +++ b/src/packet.c @@ -49,20 +49,6 @@ #include #include - -#ifdef HAVE_POLL -# include -#else -# ifdef HAVE_SELECT -# ifdef HAVE_SYS_SELECT_H -# include -# else -# include -# include -# endif -# endif -#endif - #include /* {{{ libssh2_packet_queue_listener diff --git a/src/session.c b/src/session.c index abab025..815d979 100644 --- a/src/session.c +++ b/src/session.c @@ -46,21 +46,6 @@ #include #endif -#ifdef HAVE_POLL -# include -#else -# ifdef HAVE_SELECT -# ifdef HAVE_SYS_SELECT_H -# include -# else -# include -# include -# endif -# endif -#endif - - - /* {{{ libssh2_default_alloc */ static LIBSSH2_ALLOC_FUNC(libssh2_default_alloc)