mirror of
https://github.com/wassname/ray.git
synced 2026-08-12 12:20:11 +08:00
Factor out Travis 'install' sections for use with GitHub Actions (#7988)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user