]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Fix CRAU_MAYBE_UNUSED definition for old compilers 2106/head
authorRyan Carsten Schmidt <git@ryandesign.com>
Fri, 1 May 2026 02:38:43 +0000 (21:38 -0500)
committerRyan Carsten Schmidt <git@ryandesign.com>
Fri, 1 May 2026 03:07:23 +0000 (22:07 -0500)
Fix behavior change that caused build failure with clang versions older
than 17, introduced in f5666f8f1f653cfe2bef808a9c9b61534f279ed1.

Also ensure CRAU_MAYBE_UNUSED is always defined to something, for even
older compilers.

Fixes #1880

Signed-off-by: Ryan Carsten Schmidt <git@ryandesign.com>
lib/crau/crau.h

index 53d33555be3b47aa387502a5471ef03683421186..a580532684e728c44ce292f8a8b973a5c1489c55 100644 (file)
@@ -255,10 +255,16 @@ void crau_data(struct crau_context_stack_st *stack, ...)
 #    if __has_c_attribute (__maybe_unused__)
 #     define CRAU_MAYBE_UNUSED [[__maybe_unused__]]
 #    endif
-#   elif defined(__GNUC__)
+#   endif
+#  endif /* CRAU_MAYBE_UNUSED */
+#  ifndef CRAU_MAYBE_UNUSED
+#   ifdef __GNUC__
 #    define CRAU_MAYBE_UNUSED __attribute__((__unused__))
 #   endif
 #  endif /* CRAU_MAYBE_UNUSED */
+#  ifndef CRAU_MAYBE_UNUSED
+#   define CRAU_MAYBE_UNUSED
+#  endif /* CRAU_MAYBE_UNUSED */
 
 void crau_push_context(struct crau_context_stack_st *stack CRAU_MAYBE_UNUSED,
                       long context CRAU_MAYBE_UNUSED)