From a9f1ac3a97266da1a9125c860151806312b9aa17 Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Thu, 9 Jul 2020 00:36:33 -0500 Subject: [PATCH] Include before including This is necessary for OS X 10.8 and earlier. Signed-off-by: Ryan Schmidt --- configure.ac | 2 +- src/util/virnetdev.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 0ab9bf9721..074d2b071f 100644 --- a/configure.ac +++ b/configure.ac @@ -395,7 +395,6 @@ AC_CHECK_HEADERS([\ linux/magic.h \ mntent.h \ net/ethernet.h \ - net/if.h \ pty.h \ pwd.h \ stdarg.h \ @@ -407,6 +406,7 @@ AC_CHECK_HEADERS([\ sys/ucred.h \ xlocale.h \ ]) +AC_CHECK_HEADERS([net/if.h], [], [], [[#include ]]) dnl Check whether endian provides handy macros. AC_CHECK_DECLS([htole64], [], [], [[#include ]]) AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64]) diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 78e1aa656a..55e3948afd 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -18,10 +18,6 @@ #pragma once -#ifdef HAVE_NET_IF_H -# include -#endif - #include "virbitmap.h" #include "virsocketaddr.h" #include "virmacaddr.h" @@ -29,6 +25,10 @@ #include "virnetdevvlan.h" #include "virenum.h" +#ifdef HAVE_NET_IF_H +# include +#endif + #ifdef HAVE_STRUCT_IFREQ typedef struct ifreq virIfreq; #else