summaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-07-08 10:38:59 -0400
committerNick Mathewson <nickm@torproject.org>2016-07-08 10:38:59 -0400
commitaa971c59246332391116caafd18855bccf2f99a5 (patch)
tree1877795b7f3fe57cf6b6d918017433fbabcefb57 /src/common/compat.h
parent3ac434104af0a40e75bfb5116046eae1cd51f6d3 (diff)
downloadtor-aa971c59246332391116caafd18855bccf2f99a5.tar.gz
tor-aa971c59246332391116caafd18855bccf2f99a5.zip
Move our "what time is it now" compat functions into a new module
I'm not moving our "format and parse the time" functions, since those have been pretty volatile over the last couple of years.
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 6f102becc2..54ab8b08e8 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -42,6 +42,8 @@
#include <netinet6/in6.h>
#endif
+#include "compat_time.h"
+
#if defined(__has_feature)
# if __has_feature(address_sanitizer)
/* Some of the fancy glibc strcmp() macros include references to memory that
@@ -379,15 +381,6 @@ const char *tor_fix_source_file(const char *fname);
#endif
/* ===== Time compatibility */
-#if !defined(HAVE_GETTIMEOFDAY) && !defined(HAVE_STRUCT_TIMEVAL_TV_SEC)
-/** Implementation of timeval for platforms that don't have it. */
-struct timeval {
- time_t tv_sec;
- unsigned int tv_usec;
-};
-#endif
-
-void tor_gettimeofday(struct timeval *timeval);
struct tm *tor_localtime_r(const time_t *timep, struct tm *result);
struct tm *tor_gmtime_r(const time_t *timep, struct tm *result);
@@ -737,10 +730,6 @@ char *format_win32_error(DWORD err);
#endif
-#ifdef TOR_UNIT_TESTS
-void tor_sleep_msec(int msec);
-#endif
-
#ifdef COMPAT_PRIVATE
#if !defined(HAVE_SOCKETPAIR) || defined(_WIN32) || defined(TOR_UNIT_TESTS)
#define NEED_ERSATZ_SOCKETPAIR