]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix macOS includes
authorTaylor Yu <catalyst@torproject.org>
Thu, 28 Jun 2018 22:15:53 +0000 (17:15 -0500)
committerTaylor Yu <catalyst@torproject.org>
Thu, 28 Jun 2018 22:15:53 +0000 (17:15 -0500)
Recent code movement from refactoring missed some includes that seem
to be necessary on macOS.

src/common/compat.c
src/lib/process/env.c
src/lib/string/compat_string.c
src/lib/time/compat_time.c
src/lib/time/tvdiff.c

index 6d89e1c08b4bd16cbe5a878da70660ae972d2a06..63bf99de6891c8bd03363d2a83d4ec8e59de3be5 100644 (file)
@@ -60,9 +60,6 @@
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
-#ifdef HAVE_CRT_EXTERNS_H
-#include <crt_externs.h>
-#endif
 #ifdef HAVE_SYS_STATVFS_H
 #include <sys/statvfs.h>
 #endif
index 95e1e515d4b4ef76b87af16f5a906c47c237d23b..731f609ac16fe2c42b46fd2e27c37ad14d98ff67 100644 (file)
 #endif
 #include <stdlib.h>
 #include <string.h>
+#ifdef HAVE_CRT_EXTERNS_H
+/* For _NSGetEnviron on macOS */
+#include <crt_externs.h>
+#endif
 
 #ifndef HAVE__NSGETENVIRON
 #ifndef HAVE_EXTERN_ENVIRON_DECLARED
index 3f8a4d515d2ce45ad2557b58315fb678d1991047..8b063b7242b491329bce29e3c3c98b2ce0c5e3e7 100644 (file)
@@ -15,6 +15,7 @@
 #endif
 
 #include <stdlib.h>
+#include <string.h>
 
 /** Helper for tor_strtok_r_impl: Advances cp past all characters in
  * <b>sep</b>, and returns its new value. */
index 08f99b70c94d6b6a549e3361e3d580379d6f0a78..2ea6eca988253c02631439994fd2ed1ff66c2e88 100644 (file)
@@ -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"
 
index 9fb67bcd2da4f1129897d8940049a03491c10e42..5dbc0fd19c26a750fb3bcae78005500deef18509 100644 (file)
@@ -11,6 +11,9 @@
 #ifdef _WIN32
 #include <winsock2.h>
 #endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
 
 #define TOR_USEC_PER_SEC 1000000