From: Taylor Yu Date: Thu, 28 Jun 2018 22:15:53 +0000 (-0500) Subject: Fix macOS includes X-Git-Tag: tor-0.3.5.1-alpha~307^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9e22c68a0c701745867a9dac391a70171654c75;p=thirdparty%2Ftor.git Fix macOS includes Recent code movement from refactoring missed some includes that seem to be necessary on macOS. --- diff --git a/src/common/compat.c b/src/common/compat.c index 6d89e1c08b..63bf99de68 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -60,9 +60,6 @@ #ifdef HAVE_ARPA_INET_H #include #endif -#ifdef HAVE_CRT_EXTERNS_H -#include -#endif #ifdef HAVE_SYS_STATVFS_H #include #endif diff --git a/src/lib/process/env.c b/src/lib/process/env.c index 95e1e515d4..731f609ac1 100644 --- a/src/lib/process/env.c +++ b/src/lib/process/env.c @@ -18,6 +18,10 @@ #endif #include #include +#ifdef HAVE_CRT_EXTERNS_H +/* For _NSGetEnviron on macOS */ +#include +#endif #ifndef HAVE__NSGETENVIRON #ifndef HAVE_EXTERN_ENVIRON_DECLARED diff --git a/src/lib/string/compat_string.c b/src/lib/string/compat_string.c index 3f8a4d515d..8b063b7242 100644 --- a/src/lib/string/compat_string.c +++ b/src/lib/string/compat_string.c @@ -15,6 +15,7 @@ #endif #include +#include /** Helper for tor_strtok_r_impl: Advances cp past all characters in * sep, and returns its new value. */ diff --git a/src/lib/time/compat_time.c b/src/lib/time/compat_time.c index 08f99b70c9..2ea6eca988 100644 --- a/src/lib/time/compat_time.c +++ b/src/lib/time/compat_time.c @@ -16,6 +16,7 @@ #include "lib/log/torlog.h" #include "lib/log/util_bug.h" #include "lib/intmath/muldiv.h" +#include "lib/intmath/bits.h" #include "lib/fs/winlib.h" #include "lib/wallclock/timeval.h" diff --git a/src/lib/time/tvdiff.c b/src/lib/time/tvdiff.c index 9fb67bcd2d..5dbc0fd19c 100644 --- a/src/lib/time/tvdiff.c +++ b/src/lib/time/tvdiff.c @@ -11,6 +11,9 @@ #ifdef _WIN32 #include #endif +#ifdef HAVE_SYS_TIME_H +#include +#endif #define TOR_USEC_PER_SEC 1000000