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;