diff options
author | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-03-04 15:03:58 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-03-04 15:03:58 +0300 |
commit | 0e68a9803d96e74d7905b6eb556bf142a6ba7c59 (patch) | |
tree | 0007be8795fb05a55447bb0c176dde4fe5fd2765 /library | |
parent | eb73994b2e17c4a8d67fa564298fdd26b52eb899 (diff) | |
download | ydb-0e68a9803d96e74d7905b6eb556bf142a6ba7c59.tar.gz |
Include contrib version of ares.h only for arcadia build KIKIMR-14461
ref:60b06fd84c02bf844ebd9cc7d1116d5a459adf8f
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/actors/dnscachelib/dnscache.cpp | 15 | ||||
-rw-r--r-- | library/cpp/actors/dnscachelib/dnscache.h | 15 | ||||
-rw-r--r-- | library/cpp/actors/dnscachelib/ya.make | 4 |
3 files changed, 20 insertions, 14 deletions
diff --git a/library/cpp/actors/dnscachelib/dnscache.cpp b/library/cpp/actors/dnscachelib/dnscache.cpp index 71605b9533..b72b0aea26 100644 --- a/library/cpp/actors/dnscachelib/dnscache.cpp +++ b/library/cpp/actors/dnscachelib/dnscache.cpp @@ -2,7 +2,7 @@ #include "probes.h" #include "timekeeper.h" -#include <contrib/libs/c-ares/include/ares.h> +#include <ares.h> #include <util/system/guard.h> #include <util/datetime/systime.h> @@ -442,4 +442,17 @@ TString TDnsCache::THost::AddrsV6ToString() const { return ss.Str(); } +TDnsCache::TAresLibInit::TAresLibInit() { +#ifdef _win_ + const auto res = ares_library_init(ARES_LIB_INIT_ALL); + Y_VERIFY(res == 0); +#endif +} + +TDnsCache::TAresLibInit::~TAresLibInit() { +#ifdef _win_ + ares_library_cleanup(); +#endif +} + TDnsCache::TAresLibInit TDnsCache::InitAresLib; diff --git a/library/cpp/actors/dnscachelib/dnscache.h b/library/cpp/actors/dnscachelib/dnscache.h index 6a7061e2fe..bd9c792cbd 100644 --- a/library/cpp/actors/dnscachelib/dnscache.h +++ b/library/cpp/actors/dnscachelib/dnscache.h @@ -1,6 +1,5 @@ #pragma once -#include <contrib/libs/c-ares/include/ares.h> #include <util/generic/map.h> #include <util/generic/vector.h> #include <util/network/address.h> @@ -130,18 +129,8 @@ private: void* Channel; struct TAresLibInit { - TAresLibInit() { -#ifdef _win_ - const auto res = ares_library_init(ARES_LIB_INIT_ALL); - Y_VERIFY(res == 0); -#endif - } - - ~TAresLibInit() { -#ifdef _win_ - ares_library_cleanup(); -#endif - } + TAresLibInit(); + ~TAresLibInit(); }; static TAresLibInit InitAresLib; diff --git a/library/cpp/actors/dnscachelib/ya.make b/library/cpp/actors/dnscachelib/ya.make index e3a6ad6202..4efaffa7b6 100644 --- a/library/cpp/actors/dnscachelib/ya.make +++ b/library/cpp/actors/dnscachelib/ya.make @@ -21,4 +21,8 @@ PEERDIR( library/cpp/lwtrace ) +IF (NOT EXPORT_CMAKE) +ADDINCL(contrib/libs/c-ares/include) +ENDIF() + END() |