preprocessor magic around the libidn idn_free() stuff to remain workable
authorDaniel Stenberg <daniel@haxx.se>
Tue, 25 May 2004 12:00:15 +0000 (12:00 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 May 2004 12:00:15 +0000 (12:00 +0000)
both with older libidn versions without idn_free() and with libidn versions
that gets installed without idn-free.h

lib/url.c

index 13ce60a159dd11041bd47da86ff90c7153968e1b..d65f6aec955fa221300b450a4fad08007157bec6 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
 #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>