reftable: make REFTABLE_UNUSED C99 compatible

Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED` annotation, 2025-02-18), the reftable library was migrated to use an internal version of `UNUSED`, which unconditionally sets a GNU __attribute__ to avoid warnings function parameters that are not being used. Make the definition conditional to prevent breaking the build with non GNU compilers. Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Carlo Marcelo Arenas Belón committed May 29, 2025 at 03:11 UTC f1228cd12c129a7e4da317e1d21741a3ec26e07e
1 file changed +4
reftable/basics.h
+4
@@ -16,7 +16,11 @@
16 #include "system.h"
17 #include "reftable-basics.h"
18
19 +#ifdef __GNUC__
20 #define REFTABLE_UNUSED __attribute__((__unused__))
21 +#else
22 +#define REFTABLE_UNUSED
23 +#endif
24
25 /*
26 * Initialize the buffer such that it is ready for use. This is equivalent to