#pragma once
#if defined(OS_WIN) && defined(_MSC_VER)
#include <time.h>
#include "rocksdb/rocksdb_namespace.h"
namespace ROCKSDB_NAMESPACE {
namespace port {
typedef struct timeval {
long tv_sec;
long tv_usec;
} timeval;
void gettimeofday(struct timeval* tv, struct timezone* tz);
inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
errno_t ret = localtime_s(result, timep);
return (ret == 0) ? result : NULL;
}
}
using port::timeval;
using port::gettimeofday;
using port::localtime_r;
}
#else
#include <time.h>
#include <sys/time.h>
#endif