]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Include <sys/socket.h> before including <net/if.h>
authorRyan Schmidt <git@ryandesign.com>
Thu, 9 Jul 2020 05:36:33 +0000 (00:36 -0500)
committerDaniel Berrange <berrange@redhat.com>
Mon, 20 Jul 2020 09:41:23 +0000 (09:41 +0000)
This is necessary for OS X 10.8 and earlier.

Signed-off-by: Ryan Schmidt <git@ryandesign.com>
configure.ac
src/util/virnetdev.h

index 0ab9bf9721d9ea1c3800f4462c21ad09ed610be8..074d2b071f5aa286f999590f85044f342cb06d0e 100644 (file)
@@ -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 <sys/socket.h>]])
 dnl Check whether endian provides handy macros.
 AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])
 AC_CHECK_FUNCS([stat stat64 __xstat __xstat64 lstat lstat64 __lxstat __lxstat64])
index 78e1aa656a7948c0699a426cdae1e182460ebe14..55e3948afd827d62d4c31c6235ef1def59e60c8b 100644 (file)
 
 #pragma once
 
-#ifdef HAVE_NET_IF_H
-# include <net/if.h>
-#endif
-
 #include "virbitmap.h"
 #include "virsocketaddr.h"
 #include "virmacaddr.h"
 #include "virnetdevvlan.h"
 #include "virenum.h"
 
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif
+
 #ifdef HAVE_STRUCT_IFREQ
 typedef struct ifreq virIfreq;
 #else