diff OrthancFramework/Sources/SystemToolbox.cpp @ 4552:beb8ba8a0b12 db-changes

fix build on freebsd
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 03 Mar 2021 13:44:01 +0100
parents 8a7523da6a9b
children 7053502fbf97
line wrap: on
line diff
--- a/OrthancFramework/Sources/SystemToolbox.cpp	Tue Mar 02 19:36:59 2021 +0100
+++ b/OrthancFramework/Sources/SystemToolbox.cpp	Wed Mar 03 13:44:01 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;