#define p_localtime_r(c, r) localtime_r(c, r)
#define p_gmtime_r(c, r) gmtime_r(c, r)
+#define p_timeval timeval
+
#ifdef HAVE_FUTIMENS
-GIT_INLINE(int) p_futimes(int f, const struct timeval t[2])
+GIT_INLINE(int) p_futimes(int f, const struct p_timeval t[2])
{
struct timespec s[2];
s[0].tv_sec = t[0].tv_sec;
#include "common.h"
#include "../posix.h"
+#include "win32-compat.h"
#include "path_w32.h"
#include "utf-conv.h"
#include "dir.h"
extern int p_lstat(const char *file_name, struct stat *buf);
extern int p_stat(const char* path, struct stat* buf);
-extern int p_utimes(const char *filename, const struct timeval times[2]);
-extern int p_futimes(int fd, const struct timeval times[2]);
+extern int p_utimes(const char *filename, const struct p_timeval times[2]);
+extern int p_futimes(int fd, const struct p_timeval times[2]);
extern int p_readlink(const char *path, char *buf, size_t bufsiz);
extern int p_symlink(const char *old, const char *new);
return do_lstat(filename, buf, true);
}
-int p_utimes(const char *filename, const struct timeval times[2])
+int p_utimes(const char *filename, const struct p_timeval times[2])
{
int fd, error;
return error;
}
-int p_futimes(int fd, const struct timeval times[2])
+int p_futimes(int fd, const struct p_timeval times[2])
{
HANDLE handle;
FILETIME atime = {0}, mtime = {0};
}
GIT_INLINE(void) git_win32__timeval_to_filetime(
- FILETIME *ft, const struct timeval tv)
+ FILETIME *ft, const struct p_timeval tv)
{
long long ticks = (tv.tv_sec * 10000000LL) +
(tv.tv_usec * 10LL) + 116444736000000000LL;
#include <sys/stat.h>
#include <sys/types.h>
+typedef long suseconds_t;
+
+struct p_timeval {
+ time_t tv_sec;
+ suseconds_t tv_usec;
+};
+
struct p_timespec {
time_t tv_sec;
long tv_nsec;
void tick_index(git_index *index)
{
struct timespec ts;
- struct timeval times[2];
+ struct p_timeval times[2];
cl_assert(index->on_disk);
cl_assert(git_index_path(index));
void test_core_posix__utimes(void)
{
- struct timeval times[2];
+ struct p_timeval times[2];
struct stat st;
time_t curtime;
int fd;
static int touch_file(void *payload, git_buf *path)
{
struct stat st;
- struct timeval times[2];
+ struct p_timeval times[2];
GIT_UNUSED(payload);
if (git_path_isdir(path->ptr))
git_oid initial, first, second;
git_buf path = GIT_BUF_INIT;
struct stat st;
- struct timeval times[2];
+ struct p_timeval times[2];
opts.flags |= GIT_DIFF_INCLUDE_UNTRACKED | GIT_DIFF_UPDATE_INDEX;
git_index *index;
git_diff *diff;
git_buf path = GIT_BUF_INIT;
- struct timeval times[2];
+ struct p_timeval times[2];
/* Make sure we do have a timestamp */
cl_git_pass(git_repository_index(&index, g_repo));
struct stat statbuf;
git_buf path = GIT_BUF_INIT;
git_index_entry *entry;
- struct timeval times[2];
+ struct p_timeval times[2];
time_t now;
size_t i;