Summary
The public header git2/sys/stream.h declares the git_stream read/write callbacks using ssize_t (v1.9.4, lines 59–60):
ssize_t GIT_CALLBACK(read)(struct git_stream *, void *, size_t);
ssize_t GIT_CALLBACK(write)(struct git_stream *, const char *, size_t, int);
ssize_t is POSIX, not ISO C, and is not provided by MSVC / clang-cl. The only definition in the tree is the internal src/util/win32/msvc-compat.h (typedef SSIZE_T ssize_t;), which is not part of the public/installed headers. So a Windows consumer that includes git2/sys/stream.h — e.g. to register a custom stream backend via git_stream_register — fails to compile, e.g. with clang-cl:
error: unknown type name 'ssize_t'
git2.h does not pull in sys/stream.h, so this only affects consumers using the stream/transport plugin API directly — but for those it's a hard compile error on Windows with no public type to fall back on.
Suggested fix
Make ssize_t available from a public header on Windows before it's used (in git2/sys/stream.h, or a small shared public compat shim), mirroring what msvc-compat.h already does internally:
#if defined(_WIN32) && !defined(__MINGW32__) && !defined(_SSIZE_T_DEFINED)
# include <BaseTsd.h>
typedef SSIZE_T ssize_t;
# define _SSIZE_T_DEFINED
#endif
Happy to send a PR if you'd like.
Summary
The public header
git2/sys/stream.hdeclares thegit_streamread/write callbacks usingssize_t(v1.9.4, lines 59–60):ssize_tis POSIX, not ISO C, and is not provided by MSVC / clang-cl. The only definition in the tree is the internalsrc/util/win32/msvc-compat.h(typedef SSIZE_T ssize_t;), which is not part of the public/installed headers. So a Windows consumer that includesgit2/sys/stream.h— e.g. to register a custom stream backend viagit_stream_register— fails to compile, e.g. with clang-cl:git2.hdoes not pull insys/stream.h, so this only affects consumers using the stream/transport plugin API directly — but for those it's a hard compile error on Windows with no public type to fall back on.Suggested fix
Make
ssize_tavailable from a public header on Windows before it's used (ingit2/sys/stream.h, or a small shared public compat shim), mirroring whatmsvc-compat.halready does internally:Happy to send a PR if you'd like.