summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-03-20 18:36:25 +0100
committerVicent Marti <tanoku@gmail.com>2011-03-23 00:07:58 +0200
commit56d8ca266c92e51a1b38ac68b7aa6a24193f5812 (patch)
tree83e188bcb8d157cd10774ecaabe0a4a42561f5b6 /include/git2
parentfe1920206b7fb780486dcef14d0d6f01835b430d (diff)
downloadlibgit2-56d8ca266c92e51a1b38ac68b7aa6a24193f5812.tar.gz
Switch from time_t to git_time_t
git_time_t is defined as a signed 64 integer. This allows a true predictable multiplatform behavior.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/commit.h2
-rw-r--r--include/git2/signature.h2
-rw-r--r--include/git2/types.h10
3 files changed, 7 insertions, 7 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index ba18a5b39..8306eb152 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -83,7 +83,7 @@ GIT_EXTERN(const char *) git_commit_message(git_commit *commit);
* @param commit a previously loaded commit.
* @return the time of a commit
*/
-GIT_EXTERN(time_t) git_commit_time(git_commit *commit);
+GIT_EXTERN(git_time_t) git_commit_time(git_commit *commit);
/**
* Get the commit timezone offset (i.e. committer's preferred timezone) of a commit.
diff --git a/include/git2/signature.h b/include/git2/signature.h
index 96275aa07..200397ab3 100644
--- a/include/git2/signature.h
+++ b/include/git2/signature.h
@@ -47,7 +47,7 @@ GIT_BEGIN_DECL
* @offset timezone offset in minutes for the time
* @return the new sig, NULl on out of memory
*/
-GIT_EXTERN(git_signature *) git_signature_new(const char *name, const char *email, time_t time, int offset);
+GIT_EXTERN(git_signature *) git_signature_new(const char *name, const char *email, git_time_t time, int offset);
/**
* Create a copy of an existing signature.
diff --git a/include/git2/types.h b/include/git2/types.h
index 64f7fc72e..db09f3842 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -52,12 +52,12 @@ GIT_BEGIN_DECL
#if defined(_MSC_VER)
typedef __int64 git_off_t;
-typedef __time64_t git_time_t;
+typedef __time64_t git_time_t;
#elif defined(__MINGW32__)
typedef off64_t git_off_t;
-typedef time_t git_time_t;
+typedef time64_t git_time_t;
#else /* POSIX */
@@ -66,8 +66,8 @@ typedef time_t git_time_t;
* before us (directly or indirectly), they'll get 32 bit off_t in their client
* app, even though /we/ define _FILE_OFFSET_BITS=64.
*/
-typedef long long git_off_t;
-typedef time_t git_time_t;
+typedef int64_t git_off_t;
+typedef int64_t git_time_t;
#endif
@@ -129,7 +129,7 @@ typedef struct git_index git_index;
/** Time in a signature */
typedef struct git_time {
- time_t time; /** time in seconds from epoch */
+ git_time_t time; /** time in seconds from epoch */
int offset; /** timezone offset, in minutes */
} git_time;