summaryrefslogtreecommitdiff
path: root/louloulibs/network
diff options
context:
space:
mode:
Diffstat (limited to 'louloulibs/network')
-rw-r--r--louloulibs/network/resolver.cpp6
-rw-r--r--louloulibs/network/resolver.hpp4
2 files changed, 8 insertions, 2 deletions
diff --git a/louloulibs/network/resolver.cpp b/louloulibs/network/resolver.cpp
index efb0cf0..0655b1b 100644
--- a/louloulibs/network/resolver.cpp
+++ b/louloulibs/network/resolver.cpp
@@ -4,7 +4,9 @@
#include <string.h>
#include <arpa/inet.h>
#include <netinet/in.h>
-#include <udns.h>
+#ifdef UDNS_FOUND
+# include <udns.h>
+#endif
#include <fstream>
#include <cstdlib>
@@ -14,6 +16,7 @@
using namespace std::string_literals;
+#ifdef UDNS_FOUND
static std::map<int, std::string> dns_error_messages {
{DNS_E_TEMPFAIL, "Timeout while contacting DNS servers"},
{DNS_E_PROTOCOL, "Misformatted DNS reply"},
@@ -21,6 +24,7 @@ static std::map<int, std::string> dns_error_messages {
{DNS_E_NOMEM, "Out of memory"},
{DNS_E_BADQUERY, "Misformatted domain name"}
};
+#endif
Resolver::Resolver():
#ifdef UDNS_FOUND
diff --git a/louloulibs/network/resolver.hpp b/louloulibs/network/resolver.hpp
index f516da5..800c7ec 100644
--- a/louloulibs/network/resolver.hpp
+++ b/louloulibs/network/resolver.hpp
@@ -10,7 +10,9 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
-#include <udns.h>
+#ifdef UDNS_FOUND
+# include <udns.h>
+#endif
class AddrinfoDeleter
{