mirror of
https://git.proxmox.com/git/libgit2
synced 2026-08-26 18:40:39 +00:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user