From 577ea52aba08a2c8f5d601992b518d1d69c2e779 Mon Sep 17 00:00:00 2001
From: Nick Zitzmann <nick@chronosnet.com>
Date: Tue, 7 Aug 2012 17:08:54 -0600
Subject: [PATCH 3/3] src/tool_metalink.c: Un-broke the build when building
 --with-libmetalink and --with-darwinssl

---
 src/tool_metalink.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index 3a24a15..6e4a31c 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -52,6 +52,15 @@
 #  define MD5_CTX    gcry_md_hd_t
 #  define SHA_CTX    gcry_md_hd_t
 #  define SHA256_CTX gcry_md_hd_t
+#elif defined(USE_DARWINSSL)
+/* For darwinssl: CommonCrypto has the functions we need. The library's
+   headers are even backward-compatible with OpenSSL's headers as long as
+   we define COMMON_DIGEST_FOR_OPENSSL first.
+
+   These functions are available on Tiger and later, as well as iOS 5.0
+   and later. If you're building for an older cat, well, sorry. */
+#  define COMMON_DIGEST_FOR_OPENSSL
+#  include <CommonCrypto/CommonDigest.h>
 #else
 #  error "Can't compile METALINK support without a crypto library."
 #endif
-- 
1.7.9.6 (Apple Git-31.1)


