summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-06-23 18:17:24 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2019-10-28 11:04:00 +0000
commit284d1d956960e77ef1cbaf22e0b0344c0df0c433 (patch)
tree32f2c438df06daeaeb90fdf30d5da2b9662c4851
parenta4772d6d36a143226c282888dca506b74842b741 (diff)
downloadlibgit2-ethomson/off_t_bak.tar.gz
Deprecate git_off_tethomson/off_t_bak
We used `git_off_t` in places that called for an unsigned type, causing difficulty for end users. Deprecate it, replacing it with `git_object_size_t`.
-rw-r--r--include/git2/deprecated.h2
-rw-r--r--include/git2/types.h22
2 files changed, 5 insertions, 19 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index ac1ad1a63..b2f91b9d0 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -308,6 +308,8 @@ GIT_EXTERN(int) git_index_add_frombuffer(
#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
+typedef git_object_size_t git_off_t;
+
/**
* Get the size in bytes for the structure which
* acts as an in-memory representation of any given
diff --git a/include/git2/types.h b/include/git2/types.h
index ade0c7d32..0de579615 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -36,31 +36,15 @@ GIT_BEGIN_DECL
#include <stdint.h>
#endif
+/** Time in seconds from the Unix epoch */
#if defined(_MSC_VER)
-
-typedef __int64 git_off_t;
typedef __time64_t git_time_t;
-
#elif defined(__MINGW32__)
-
-typedef off64_t git_off_t;
typedef __time64_t git_time_t;
-
#elif defined(__HAIKU__)
-
-typedef __haiku_std_int64 git_off_t;
typedef __haiku_std_int64 git_time_t;
-
-#else /* POSIX */
-
-/*
- * Note: Can't use off_t since if a client program includes <sys/types.h>
- * 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 int64_t git_off_t;
-typedef int64_t git_time_t; /**< time in seconds from epoch */
-
+#else
+typedef int64_t git_time_t;
#endif
/** The maximum size of an object */