summaryrefslogtreecommitdiff
path: root/src/signature.c
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-05-15 15:41:05 -0700
committerBen Straub <bstraub@github.com>2012-05-15 15:41:05 -0700
commit1ce4cc0164fbc14fcb7f686483aa581bc946bfdb (patch)
tree628f63f6508247275eac89357b8b1b960d68f23b /src/signature.c
parent7c22e72ba65fa4ac9c2989d115435aa60788136c (diff)
downloadlibgit2-1ce4cc0164fbc14fcb7f686483aa581bc946bfdb.tar.gz
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.
Diffstat (limited to 'src/signature.c')
-rw-r--r--src/signature.c12
1 files changed, 0 insertions, 12 deletions
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;