From 172d1dce6a099f32d31321b5aeee4675acec6ebb Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Wed, 27 Dec 2023 19:13:02 +0100 Subject: [PATCH 1/2] Fixed openssl/types.h include for ubuntu20.04 --- cpr/ssl_ctx.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpr/ssl_ctx.cpp b/cpr/ssl_ctx.cpp index f628809bb..64f3d384c 100644 --- a/cpr/ssl_ctx.cpp +++ b/cpr/ssl_ctx.cpp @@ -11,10 +11,16 @@ #include #include #include -#include #include #include +// openssl/types.h was added in later version of openssl and is therefore not always available. +// This is for example the case on Ubuntu 20.04. +// We try to include it if available to satisfy clang-tidy. +#if __has_include() +#include +#endif + namespace cpr { /** From 3afce761e828dfa7adfb8b1d19a1dad72be53146 Mon Sep 17 00:00:00 2001 From: Fabian Sauter Date: Wed, 27 Dec 2023 19:17:02 +0100 Subject: [PATCH 2/2] Using openssl/ossl_typ.h if openssl/types.h is not available --- cpr/ssl_ctx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpr/ssl_ctx.cpp b/cpr/ssl_ctx.cpp index 64f3d384c..ed5e09b13 100644 --- a/cpr/ssl_ctx.cpp +++ b/cpr/ssl_ctx.cpp @@ -17,8 +17,11 @@ // openssl/types.h was added in later version of openssl and is therefore not always available. // This is for example the case on Ubuntu 20.04. // We try to include it if available to satisfy clang-tidy. +// Ref: https://github.com/openssl/openssl/commit/50cd4768c6b89c757645f28519236bb989216f8d #if __has_include() #include +#else +#include #endif namespace cpr {