From 43c5388470c66dc0948549af8e4f2d572e23b5f6 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 11 Oct 2013 15:43:30 +0200 Subject: [PATCH] tun-device: Rearrange headers to build properly when tun devices not supported --- src/libstrongswan/networking/tun_device.c | 36 ++++++++++------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/libstrongswan/networking/tun_device.c b/src/libstrongswan/networking/tun_device.c index f2c7b162f..ff2c4a337 100644 --- a/src/libstrongswan/networking/tun_device.c +++ b/src/libstrongswan/networking/tun_device.c @@ -16,6 +16,21 @@ * for more details. */ +#include "tun_device.h" + +#include +#include + +#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H) + +tun_device_t *tun_device_create(const char *name_tmpl) +{ + DBG1(DBG_LIB, "TUN devices are not supported"); + return NULL; +} + +#else /* TUN devices supported */ + #include #include #include @@ -27,22 +42,6 @@ #include #include -#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H) - -#include "tun_device.h" - -#include - -#warning TUN devices are not supported! - -tun_device_t *tun_device_create(const char *name_tmpl) -{ - DBG1(DBG_LIB, "TUN devices are not supported"); - return NULL; -} - -#else /* TUN devices supported */ - #ifdef __APPLE__ #include #include @@ -58,11 +57,6 @@ tun_device_t *tun_device_create(const char *name_tmpl) #include #endif -#include "tun_device.h" - -#include -#include - #define TUN_DEFAULT_MTU 1500 typedef struct private_tun_device_t private_tun_device_t;