libgit2 icon indicating copy to clipboard operation
libgit2 copied to clipboard

Define correct `off64_t` for AIX

Open bzEq opened this issue 3 years ago • 1 comments

off64_t is long long on AIX, see /usr/include/sys/types.h on AIX.

bzEq avatar Aug 09 '22 02:08 bzEq

Does AIX not define int64_t? I would have expected the final else would have sufficed here, especially since we use int64_t in a lot of other places. 🤔

ethomson avatar Sep 19 '22 09:09 ethomson

Does AIX not define int64_t?

Actually, it does. It defines

#ifdef  __64BIT__
typedef signed long   int64_t;

However, it also defines typedef long long off64_t in its sys/types.h which is included by some c headers on AIX. If fallback to typedef int64_t off64_t on AIX, we will define off64_t more than one time and the underlying type of off64_t is inconsistent between src/util/posix.h and AIX's <sys/types.h>(signed long vs long long).

bzEq avatar Sep 22 '22 08:09 bzEq

Thanks for the fix!

ethomson avatar Feb 14 '23 15:02 ethomson