From 8ff3edf49f82d1a8197d0398e06e6cb79dbdccca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20L=C3=83=C2=A9caille?= Date: Thu, 4 Jan 2024 13:56:44 +0100 Subject: [PATCH] BUILD: quic: Missing quic_ssl.h header protection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Such "#ifdef USE_QUIC" prepocessor statements are used by QUIC C header to avoid inclusion of QUIC headers when the QUIC support is not enabled (by USE_QUIC make variable). Furthermore, this allows inclusions of QUIC header from C file without having to protect them with others "#ifdef USE_QUIC" statements as follows: #ifdef USE_QUIC #include #include #endif /* USE_QUIC */ So, here if this quic_ssl.h header was included by a C file, and compiled without QUIC support, this will lead to build errrors as follows: In file included from : include/haproxy/quic_ssl.h:35:35: warning: ‘enum ssl_encryption_level_t’ declared inside parameter list will not be visible outside of this definition or declaration Should be backported to 2.9 to avoid such building issues to come. (cherry picked from commit fd178ccdb0e0c22ce784d53762bef33b5709bdaa) Signed-off-by: Willy Tarreau --- include/haproxy/quic_ssl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/haproxy/quic_ssl.h b/include/haproxy/quic_ssl.h index f564770..8f7df47 100644 --- a/include/haproxy/quic_ssl.h +++ b/include/haproxy/quic_ssl.h @@ -21,6 +21,11 @@ #ifndef _HAPROXY_QUIC_SSL_H #define _HAPROXY_QUIC_SSL_H +#ifdef USE_QUIC +#ifndef USE_OPENSSL +#error "Must define USE_OPENSSL" +#endif + #include #include #include @@ -46,4 +51,5 @@ static inline void qc_free_ssl_sock_ctx(struct ssl_sock_ctx **ctx) *ctx = NULL; } +#endif /* USE_QUIC */ #endif /* _HAPROXY_QUIC_SSL_H */ -- 1.7.10.4