#include <cstdint>
-#include <Windows.h>
-
extern "C" {
-int gettimeofday(timeval* tv, timezone*) {
+int gettimeofday(timeval* tv, struct timezone*) {
constexpr auto posixWinFtOffset = 116444736000000000ULL;
if (tv) {
};
extern "C" {
-int gettimeofday(timeval* tv, timezone*);
+// Note that this needs to explicitly be `struct timezone` due to the fact that
+// the python 3 headers `#define timezone _timezone` on Windows. `_timezone` is
+// a global field that contains information on the current timezone. By
+// explicitly specifying that this is a `struct`, we ensure that it's treated as
+// a type, regardless of what name that type actually is :)
+// Note that this will break if `gettimeofday` ever becomes declared as anything
+// other than `extern "C"`, as the mangled name would be dependent on whether
+// python had been included before this header.
+int gettimeofday(timeval* tv, struct timezone*);
void timeradd(timeval* a, timeval* b, timeval* res);
void timersub(timeval* a, timeval* b, timeval* res);
}