From 0482130edc082199808b14ec0f048fe27957918b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 18 Jul 2025 18:37:56 +0200 Subject: [PATCH] fix builds with !http + nghttp2 _buildroulette/lib/http2.c:218:24: error: field has incomplete type 'struct h1_req_parser' 218 | struct h1_req_parser h1; /* parsing the request */ | ^ _buildroulette/lib/http2.c:218:10: note: forward declaration of 'struct h1_req_parser' 218 | struct h1_req_parser h1; /* parsing the request */ | ^ _buildroulette/lib/http2.c:258:3: error: call to undeclared function 'Curl_h1_req_parse_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-funct 258 | Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); | ^ _buildroulette/lib/http2.c:258:39: error: use of undeclared identifier 'H1_PARSE_DEFAULT_MAX_LINE_LEN' 258 | Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN); | ^ _buildroulette/lib/http2.c:282:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-funct 282 | Curl_h1_req_parse_free(&stream->h1); | ^ _buildroulette/lib/http2.c:2237:14: error: call to undeclared function 'Curl_h1_req_parse_read'; ISO C99 and later do not support implicit function declarations [-Wimplicit-fun 2237 | nwritten = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL, 0, &result); | ^ _buildroulette/lib/http2.c:2251:3: error: call to undeclared function 'Curl_h1_req_parse_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-func 2251 | Curl_h1_req_parse_free(&stream->h1); | ^ _buildroulette/lib/http2.c:2866:19: error: no member named 'http_neg' in 'struct UrlState' 2866 | (data->state.http_neg.wanted & CURL_HTTP_V2x) && | ~~~~~~~~~~~ ^ _buildroulette/lib/http2.c:2867:18: error: no member named 'http_neg' in 'struct UrlState' 2867 | data->state.http_neg.h2_prior_knowledge) { | ~~~~~~~~~~~ ^ 8 errors generated. --- lib/http2.c | 6 +++--- lib/version.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/http2.c b/lib/http2.c index 2d7a571d10..395195fc53 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -24,7 +24,7 @@ #include "curl_setup.h" -#ifdef USE_NGHTTP2 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) #include #include #include "urldata.h" @@ -3008,7 +3008,7 @@ void *Curl_nghttp2_realloc(void *ptr, size_t size, void *user_data) return Curl_crealloc(ptr, size); } -#else /* !USE_NGHTTP2 */ +#else /* CURL_DISABLE_HTTP || !USE_NGHTTP2 */ /* Satisfy external references even if http2 is not compiled in. */ #include @@ -3027,4 +3027,4 @@ char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) return NULL; } -#endif /* USE_NGHTTP2 */ +#endif /* !CURL_DISABLE_HTTP && USE_NGHTTP2 */ diff --git a/lib/version.c b/lib/version.c index bf4c76d016..d58e068c53 100644 --- a/lib/version.c +++ b/lib/version.c @@ -197,7 +197,7 @@ char *curl_version(void) #ifdef USE_SSH char ssh_version[30]; #endif -#ifdef USE_NGHTTP2 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) char h2_version[30]; #endif #ifdef USE_HTTP3 @@ -258,7 +258,7 @@ char *curl_version(void) Curl_ssh_version(ssh_version, sizeof(ssh_version)); src[i++] = ssh_version; #endif -#ifdef USE_NGHTTP2 +#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) Curl_http2_ver(h2_version, sizeof(h2_version)); src[i++] = h2_version; #endif @@ -488,7 +488,7 @@ static const struct feat features_table[] = { #ifndef CURL_DISABLE_HSTS FEATURE("HSTS", NULL, CURL_VERSION_HSTS), #endif -#if defined(USE_NGHTTP2) +#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) FEATURE("HTTP2", NULL, CURL_VERSION_HTTP2), #endif #if defined(USE_HTTP3)