Subject: Re: [PATCH 1/6] reftable/system: provide `REFTABLE_INLINE()` macro

From: Junio C Hamano <[email-masked]>
Date: Tue, 31 Mar 2026 11:03:14 -0700

Patrick Steinhardt <[email-masked]> 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.