Factor out Travis 'install' sections for use with GitHub Actions (#7988)

This commit is contained in:
mehrdadn
2020-04-15 08:10:22 -07:00
committed by GitHub
parent 428516056a
commit ba00c29b67
21 changed files with 519 additions and 384 deletions
+10
View File
@@ -1,6 +1,12 @@
#include <limits.h>
#include <sys/time.h>
#ifdef timezone
#pragma push_macro("timezone") // Work around https://bugs.python.org/issue34657
#undef timezone
#define timezone timezone
#endif
int gettimeofday(struct timeval *tv, struct timezone *tz) {
// Free implementation from: https://stackoverflow.com/a/26085827
SYSTEMTIME systime;
@@ -16,3 +22,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz) {
tv->tv_usec = static_cast<int>(systime.wMilliseconds * 1000);
return 0;
}
#ifdef timezone
#pragma pop_macro("timezone")
#endif
+10
View File
@@ -1,6 +1,12 @@
#ifndef TIME_H
#define TIME_H
#ifdef timezone
#pragma push_macro("timezone") // Work around https://bugs.python.org/issue34657
#undef timezone
#define timezone timezone
#endif
#include <WinSock2.h> // clients require timeval definition
struct timeval;
@@ -12,4 +18,8 @@ extern "C"
int
gettimeofday(struct timeval *tv, struct timezone *tz);
#ifdef timezone
#pragma pop_macro("timezone")
#endif
#endif /* TIME_H */