Skip to content

Commit

Permalink
Merge pull request #1002 from libcpr/fix/openssl_include_ubuntu20_04
Browse files Browse the repository at this point in the history
Fixed openssl/types.h include for ubuntu20.04
  • Loading branch information
COM8 authored Dec 28, 2023
2 parents 3100118 + 3afce76 commit 1b31ea4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cpr/ssl_ctx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@
#include <openssl/bio.h>
#include <openssl/pem.h>
#include <openssl/ssl.h>
#include <openssl/types.h>
#include <openssl/x509.h>
#include <openssl/x509_vfy.h>

// 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(<openssl/types.h>)
#include <openssl/types.h>
#else
#include <openssl/ossl_typ.h>
#endif

namespace cpr {

/**
Expand Down

0 comments on commit 1b31ea4

Please sign in to comment.