Received: from eggs.gnu.org ([2001:4830:134:3::10]:54424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmkI0-0004Uz-3d for qemu-devel@nongnu.org; Wed, 12 Jun 2013 08:36:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmkHy-0003Kx-4y for qemu-devel@nongnu.org; Wed, 12 Jun 2013 08:36:36 -0400 From: Michael Tokarev Date: Wed, 12 Jun 2013 16:36:28 +0400 Message-Id: <1371040588-17938-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] [PATCH trivial] main-loop: do not include slirp/slirp.h, use libslirp.h instead List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Michael Tokarev The header slirp/slirp.h is an internal header for slirp, and main-loop.c does not use internals from there. Instead, it uses public functions (slirp_update_timeout(), slirp_pollfds_fill() etc) which are declared in qemu/libslirp.h. Including slirp/slirp.h is somewhat dangerous since it redefines errno on WIN32, so any file including it may misbehave wrt errno. Unfortunately libslirp isn't self-contained, it needs declaration of struct in_addr, which is provided by qemu/sockets.h. Maybe instead of #including qemu/sockets.h before libslirp.h, it is better to make the latter self-contained. Signed-off-by: Michael Tokarev --- main-loop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main-loop.c b/main-loop.c index cf36645..a44fff6 100644 --- a/main-loop.c +++ b/main-loop.c @@ -24,7 +24,8 @@ #include "qemu-common.h" #include "qemu/timer.h" -#include "slirp/slirp.h" +#include "qemu/sockets.h" // struct in_addr needed for libslirp.h +#include "slirp/libslirp.h" #include "qemu/main-loop.h" #include "block/aio.h" -- 1.7.10.4