Re: [PATCH 1/6] reftable/system: provide `REFTABLE_INLINE()` macro
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 31, 2026, 18:03 UTC
- Message-ID
- <xmqqbjg327x9.fsf@gitster.g>
- In-Reply-To
- <20260331-pks-reftable-portability-fixes-v1-1-46bfae55c68c@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 8 quoted lines
> 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.
Show 13 quoted lines
> 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.