aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2017-05-01 13:44:39 -0400
committerJay Satiro <raysatiro@yahoo.com>2017-05-01 14:48:34 -0400
commit499a7288fe831ef51a9b0930fc67bcd97aa6c675 (patch)
tree47883613f5a18b5da165054454c41b61491f46fb
parent0912a5c760dd9b85692e121313a04797b52d4ab2 (diff)
curl_setup: Ensure no more than one IDN lib is enabled
Prior to this change it was possible for libcurl to be built with both Windows' native IDN lib (normaliz) and libidn2 enabled. It appears that doesn't offer any benefit --and could cause a bug-- since libcurl's IDN handling is written to use either one but not both. Bug: https://github.com/curl/curl/issues/1441#issuecomment-297689856 Reported-by: Gisle Vanem
-rw-r--r--lib/curl_setup.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h
index dda1c751e..d22997cc9 100644
--- a/lib/curl_setup.h
+++ b/lib/curl_setup.h
@@ -588,11 +588,15 @@ int netware_init(void);
#endif
#endif
-#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H)
+#if defined(HAVE_LIBIDN2) && defined(HAVE_IDN2_H) && !defined(USE_WIN32_IDN)
/* The lib and header are present */
#define USE_LIBIDN2
#endif
+#if defined(USE_LIBIDN2) && defined(USE_WIN32_IDN)
+#error "Both libidn2 and WinIDN are enabled, choose one."
+#endif
+
#ifndef SIZEOF_TIME_T
/* assume default size of time_t to be 32 bit */
#define SIZEOF_TIME_T 4