From 1ce4cc0164fbc14fcb7f686483aa581bc946bfdb Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Tue, 15 May 2012 15:41:05 -0700 Subject: Fix date.c build in msvc. Ported the win32 implementations of gmtime_r, localtime_r, and gettimeofday to be part of the posix compatibility layer, and fixed git_signature_now to use them. --- src/signature.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/signature.c') diff --git a/src/signature.c b/src/signature.c index 4d6d11c70..74ef84376 100644 --- a/src/signature.c +++ b/src/signature.c @@ -113,26 +113,14 @@ int git_signature_now(git_signature **sig_out, const char *name, const char *ema time_t offset; struct tm *utc_tm, *local_tm; git_signature *sig; - -#ifndef GIT_WIN32 struct tm _utc, _local; -#endif *sig_out = NULL; time(&now); - /** - * On Win32, `gmtime_r` doesn't exist but - * `gmtime` is threadsafe, so we can use that - */ -#ifdef GIT_WIN32 - utc_tm = gmtime(&now); - local_tm = localtime(&now); -#else utc_tm = gmtime_r(&now, &_utc); local_tm = localtime_r(&now, &_local); -#endif offset = mktime(local_tm) - mktime(utc_tm); offset /= 60; -- cgit v1.2.1