]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable: make REFTABLE_UNUSED C99 compatible
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Thu, 29 May 2025 10:11:36 +0000 (03:11 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 May 2025 16:18:53 +0000 (09:18 -0700)
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>
reftable/basics.h

index d8888c126290cf012ec15128b425f835e3e6cd5b..7d22f96261072ac8cb1b64e8d86a9c2feeb6afdd 100644 (file)
 #include "system.h"
 #include "reftable-basics.h"
 
+#ifdef __GNUC__
 #define REFTABLE_UNUSED __attribute__((__unused__))
+#else
+#define REFTABLE_UNUSED
+#endif
 
 /*
  * Initialize the buffer such that it is ready for use. This is equivalent to