Skip to content

Commit

Permalink
rec: Fix Lua-enabled compilation on OS X and FreeBSD
Browse files Browse the repository at this point in the history
(cherry picked from commit 546d1fb)
  • Loading branch information
rgacogne committed Sep 27, 2016
1 parent 20cac88 commit f8a00d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pdns/lua-recursor4.cc
Expand Up @@ -263,8 +263,8 @@ RecursorLua4::RecursorLua4(const std::string& fname)
return DNSName(boost::get<const DNSName>(dom));
});
d_lw->registerFunction("isPartOf", &DNSName::isPartOf);
d_lw->registerFunction("countLabels", &DNSName::countLabels);
d_lw->registerFunction("wirelength", &DNSName::wirelength);
d_lw->registerFunction<unsigned int(DNSName::*)()>("countLabels", [](const DNSName& name) { return name.countLabels(); });
d_lw->registerFunction<size_t(DNSName::*)()>("wirelength", [](const DNSName& name) { return name.wirelength(); });
d_lw->registerFunction<bool(DNSName::*)(const std::string&)>(
"equal",
[](const DNSName& lhs, const std::string& rhs) {
Expand All @@ -285,9 +285,9 @@ RecursorLua4::RecursorLua4(const std::string& fname)
} );
d_lw->registerFunction<bool(ComboAddress::*)()>("isIPv4", [](const ComboAddress& ca) { return ca.sin4.sin_family == AF_INET; });
d_lw->registerFunction<bool(ComboAddress::*)()>("isIPv6", [](const ComboAddress& ca) { return ca.sin4.sin_family == AF_INET6; });
d_lw->registerFunction("isMappedIPv4", &ComboAddress::isMappedIPv4);
d_lw->registerFunction("mapToIPv4", &ComboAddress::mapToIPv4);
d_lw->registerFunction("truncate", &ComboAddress::truncate);
d_lw->registerFunction<bool(ComboAddress::*)()>("isMappedIPv4", [](const ComboAddress& ca) { return ca.isMappedIPv4(); });
d_lw->registerFunction<ComboAddress(ComboAddress::*)()>("mapToIPv4", [](const ComboAddress& ca) { return ca.mapToIPv4(); });
d_lw->registerFunction<void(ComboAddress::*)(unsigned int)>("truncate", [](ComboAddress& ca, unsigned int bits) { ca.truncate(bits); });

d_lw->writeFunction("newCA", [](const std::string& a) { return ComboAddress(a); });
typedef std::unordered_set<ComboAddress,ComboAddress::addressOnlyHash,ComboAddress::addressOnlyEqual> cas_t;
Expand Down

0 comments on commit f8a00d4

Please sign in to comment.