Files
libgit2/deps/reftable/reftable-system.h
Patrick Steinhardt 9e3b00acfb deps/reftable: implement system compatibility code
While the reftable library is mostly decoupled from the Git codebase,
some specific functionality intentionally taps into Git subsystems. To
make porting of the reftable library easier all of these are contained
in "system.h" and "system.c".

Reimplement those compatibility shims so that they work for libgit2.
2026-04-16 14:56:46 +02:00

34 lines
888 B
C

#ifndef REFTABLE_SYSTEM_H
#define REFTABLE_SYSTEM_H
/*
* This header defines the platform-specific bits required to compile the
* reftable library. It should provide an environment that bridges over the
* gaps between POSIX and your system, as well as the zlib interfaces. This
* header is expected to be changed by the individual project.
*/
#include "map.h"
#include "posix.h"
#include "util.h"
#include <zlib.h>
/*
* We only need to redefine on Windows as we expect stat(3p) et al to be
* available on Unix platforms. Furthermore, we only need to redefine fstat(3p)
* because we already redefine stat(3p) "win32-compat.h".
*/
#ifdef GIT_WIN32
# define fstat(fd, st) p_fstat(fd, st)
#endif
#define fsync(fd) p_fsync(fd)
#define poll(fds, fds_len, timeout) p_poll(fds, fds_len, timeout)
#define REFTABLE_ALLOW_BANNED_ALLOCATORS
#define inline GIT_INLINE_KEYWORD
#endif