aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-25 12:00:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-25 12:00:15 +0000
commit0912015a5c34ade7acad04db43604f781cd8306e (patch)
treea97c799bdda557497a6fff6632f22f449c2bb662 /lib/url.c
parent4e7575fc7a5e909480f0b6c53ab1de4dd3219c01 (diff)
preprocessor magic around the libidn idn_free() stuff to remain workable
both with older libidn versions without idn_free() and with libidn versions that gets installed without idn-free.h
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 13ce60a15..d65f6aec9 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -87,9 +87,18 @@
#ifdef USE_LIBIDN
#include <idna.h>
#include <stringprep.h>
+#ifdef HAVE_IDN_FREE_H
+#include <idn-free.h>
+#else
void idn_free (void *ptr); /* prototype from idn-free.h, not provided by
libidn 0.4.5's make install! */
#endif
+#ifndef HAVE_IDN_FREE
+/* if idn_free() was not found in this version of libidn, use plain free()
+ instead */
+#define idn_free(x) (free)(x)
+#endif
+#endif
#ifdef HAVE_OPENSSL_ENGINE_H
#include <openssl/engine.h>