8000 Deprecate git_off_t · libgit2/libgit2@5d18fc5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d18fc5

Browse files
committed
Deprecate git_off_t
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`.
1 parent 228b097 commit 5d18fc5

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

include/git2/deprecated.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ GIT_EXTERN(int) git_index_add_frombuffer(
287287
#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
288288
#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
289289

290+
typedef git_object_size_t git_off_t;
291+
290292
GIT_EXTERN(size_t) git_object__size(git_object_t type);
291293

292294
/**@}*/

include/git2/types.h

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,15 @@ GIT_BEGIN_DECL
3636
#include <stdint.h>
3737
#endif
3838

39+
/** Time in seconds from the Unix epoch */
3940
#if defined(_MSC_VER)
40-
41-
typedef __int64 git_off_t;
4241
typedef __time64_t git_time_t;
43-
4442
#elif defined(__MINGW32__)
45-
46-
typedef off64_t git_off_t;
4743
typedef __time64_t git_time_t;
48-
4944
#elif defined(__HAIKU__)
50-
51-
typedef __haiku_std_int64 git_off_t;
5245
typedef __haiku_std_int64 git_time_t;
53-
54-
#else /* POSIX */
55-
56-
/*
57-
* Note: Can't use off_t since if a client program includes <sys/types.h>
58-
* before us (directly or indirectly), they'll get 32 bit off_t in their client
59-
* app, even though /we/ define _FILE_OFFSET_BITS=64.
60-
*/
61-
typedef int64_t git_off_t;
62-
typedef int64_t git_time_t; /**< time in seconds from epoch */
63-
46+
#else
47+
typedef int64_t git_time_t;
6448
#endif
6549

6650
/** The maximum size of an object */

0 commit comments

Comments
 (0)
0