summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-11 23:10:12 +0100
committerChristian Grothoff <christian@grothoff.org>2019-02-11 23:10:12 +0100
commitb3dfd8d3e2cd9412b598d2c5c26228cdc930cc0b (patch)
treebf9083432381fa8ef0fc23280c60eaaf75b52dfe
parent270b5b2ad07eb6c419078e4b7ceea9791c5625f6 (diff)
use idn2.h or idna.h depending on HAVE_LIBIDN/HAVE_LIBIDN
-rw-r--r--configure.ac2
-rw-r--r--src/util/dnsparser.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 38182599f..14360284a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -862,7 +862,7 @@ AS_IF([test x$my_with_libidn2 = x1],
LIBS="-lidn2 $LIBS"
AC_DEFINE_UNQUOTED([HAVE_LIBIDN2],
[1],
- [Define to 1 if you have 'libidn2' (-lidn).])],
+ [Define to 1 if you have 'libidn2' (-lidn2).])],
[MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2"
MISSING_SEP=", "])])
AM_CONDITIONAL(HAVE_LIBIDN2, test x$working_libidn2 = x1)
diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c
index 2baa76ef2..55a9ff6c8 100644
--- a/src/util/dnsparser.c
+++ b/src/util/dnsparser.c
@@ -25,15 +25,19 @@
* @author Christian Grothoff
*/
#include "platform.h"
+#if HAVE_LIBIDN2
#if HAVE_IDN2_H
#include <idn2.h>
#elif HAVE_IDN2_IDN2_H
#include <idn2/idn2.h>
-#elif HAVE_IDNA_H
+#endif
+#elif HAVE_LIBIDN
+#if HAVE_IDNA_H
#include <idna.h>
#elif HAVE_IDN_IDNA_H
#include <idn/idna.h>
#endif
+#endif
#if WINDOWS
#include <idn-free.h>
#endif