From 371edb5cdbdc53ca1c952cfc180318634e396015 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Tue, 4 Jun 2024 03:17:44 +0800
Subject: [PATCH] configure.ac: fix header checks for macOS (#1224)

Co-authored-by: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9ab62e88..81ed3247 100644
--- configure.ac
+++ configure.ac
@@ -58,7 +58,6 @@ fcntl.h \
 getopt.h \
 ifaddrs.h \
 netdb.h \
-net/if.h \
 netinet/in.h \
 netinet/tcp.h \
 pthread.h \
@@ -74,7 +73,8 @@ unistd.h \
 ], [], AC_MSG_ERROR([Required header not found]))
 
 # Checks for header files with prerequisites of other headers.
-AC_CHECK_HEADERS([net/route.h], [], AC_MSG_ERROR([Required header not found]), [#include <net/if.h>])
+AC_CHECK_HEADERS([net/if.h], [], AC_MSG_ERROR([Required header not found]), [#include <sys/socket.h>])
+AC_CHECK_HEADERS([net/route.h], [], AC_MSG_ERROR([Required header not found]), [#include <sys/socket.h>], [#include <net/if.h>])
 
 # Checks for optional header files.
 AC_CHECK_HEADERS([ \
