From: Tobias Brunner Date: Fri, 20 Dec 2013 10:24:02 +0000 (+0100) Subject: tun-device: Include system headers before our own X-Git-Tag: 5.1.2dr3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfa2201537cb0a1c33ae38201accde8067902135;p=thirdparty%2Fstrongswan.git tun-device: Include system headers before our own On CentOS 6.5 the sys/capability.h header file defines _LINUX_TYPES_H without actually including that header, preventing its later inclusion here. As library.h (via which the capabilities headers are included) is not actually required in tun_device.[ch], moving the inclusion of tun_device.h would not strictly be necessary. But it's probably a good idea to include our own headers after system headers anyway, for if one of the recursively included files at a later point includes library.h we'd have the same problem again. --- diff --git a/src/libstrongswan/networking/tun_device.c b/src/libstrongswan/networking/tun_device.c index ef296357e2..ecefdc233f 100644 --- a/src/libstrongswan/networking/tun_device.c +++ b/src/libstrongswan/networking/tun_device.c @@ -27,9 +27,11 @@ #include #include +#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H) + #include "tun_device.h" -#if !defined(__APPLE__) && !defined(__linux__) && !defined(HAVE_NET_IF_TUN_H) +#include #warning TUN devices are not supported! @@ -52,7 +54,8 @@ tun_device_t *tun_device_create(const char *name_tmpl) #include #endif -#include +#include "tun_device.h" + #include #include diff --git a/src/libstrongswan/networking/tun_device.h b/src/libstrongswan/networking/tun_device.h index 1d330f133a..543125bebf 100644 --- a/src/libstrongswan/networking/tun_device.h +++ b/src/libstrongswan/networking/tun_device.h @@ -23,7 +23,6 @@ #ifndef TUN_DEVICE_H_ #define TUN_DEVICE_H_ -#include #include typedef struct tun_device_t tun_device_t;