changeset 4553:f21bc79e0f31

fix build on freebsd
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 Mar 2021 13:48:45 +0100
parents 49971e7b75fb
children 2b64cc3cea99
files OrthancFramework/Sources/SystemToolbox.cpp
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/SystemToolbox.cpp	Tue Mar 02 14:53:35 2021 +0100
+++ b/OrthancFramework/Sources/SystemToolbox.cpp	Wed Mar 03 13:48:45 2021 +0100
@@ -43,6 +43,10 @@
 #if defined(__APPLE__) && defined(__MACH__)
 #  include <limits.h>        // PATH_MAX
 #  include <mach-o/dyld.h>   // _NSGetExecutablePath
+#endif
+
+
+#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
 #  include <net/if_dl.h>     // For GetMacAddresses()
 #  include <net/if_types.h>  // For GetMacAddresses()
 #  include <sys/sysctl.h>    // For GetMacAddresses()
@@ -1078,7 +1082,7 @@
 
       while (!interfaces.IsDone())
       {
-#if defined(__APPLE__) && defined(__MACH__)
+#if (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
         int mib[6];
         mib[0] = CTL_NET;
         mib[1] = AF_ROUTE;