Skip to content

Commit

Permalink
dns: Support c-ares before 1.22
Browse files Browse the repository at this point in the history
ares_channel_t has been introduced in c-ares 1.22 (November 2023). This
version is not yet in most Linux distributions with long version cycles,
e.g. Debian.

A simple and easy to maintain solution is to provide a compatibility
typedef.

This fixes build failure on older c-ares, which was introduced in
7139445

Closes #2493
  • Loading branch information
p12tic authored and xemul committed Oct 14, 2024
1 parent 69a344b commit 0ec7441
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/net/dns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ std::ostream& operator<<(std::ostream& os, const opt_family& f) {

}

#if (ARES_VERSION < 0x011600)
// ares_channel_t is only present since c-ares 1.22.0 (November 2023)
typedef struct ares_channeldata ares_channel_t;
#endif

#if FMT_VERSION >= 90000
template <> struct fmt::formatter<seastar::net::opt_family> : fmt::ostream_formatter {};
#endif
Expand Down

0 comments on commit 0ec7441

Please sign in to comment.