From: Junio C Hamano Date: Tue, 31 Mar 2026 18:03:14 GMT Subject: Re: [PATCH 1/6] reftable/system: provide `REFTABLE_INLINE()` macro Message-ID: In-Reply-To: <20260331-pks-reftable-portability-fixes-v1-1-46bfae55c68c@pks.im> Patrick Steinhardt writes: > Not every compiler knows about the `inline` annotation for functions. > Consequently, Git knows to define `inline` as an empty macro in case > it's not available. > > In the reftable library though we cannot assume the macro to be > available as it is usable as a standalone library. Fix this by > introducing a `REFTABLE_INLINE()` macro via "reftable/system.h" that > allows the project to use their own definition. And our `inline` would be used to define REFTABLE_INLINE() in the context of this project? Makes sense to me. > diff --git a/reftable/system.h b/reftable/system.h > index c54ed4cad6..b15768dbdb 100644 > --- a/reftable/system.h > +++ b/reftable/system.h > @@ -15,6 +15,8 @@ > #include "compat/posix.h" > #include "compat/zlib-compat.h" > > +#define REFTABLE_INLINE(type) static inline type > + > /* > * Return a random 32 bit integer. This function is expected to return > * pre-seeded data.