diff --git a/lib/md5.c b/lib/md5.c
index 57efa43..dd5eba2 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -90,13 +90,14 @@ static void MD5_Final(unsigned char digest[16], MD5_CTX * ctx)
 #    include <md5.h>
 #  endif
 
-#elif defined(__MAC_10_4) || defined(__IPHONE_5_0)
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 || \
+      __IPHONE_OS_VERSION_MAX_ALLOWED >= 20000
 
 /* For Apple operating systems: 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
+   These functions are available on Tiger and later, as well as iOS 2.0
    and later. If you're building for an older cat, well, sorry. */
 #  define COMMON_DIGEST_FOR_OPENSSL
 #  include <CommonCrypto/CommonDigest.h>
diff --git a/src/tool_metalink.c b/src/tool_metalink.c
index f9e9869..c15c2fc 100644
--- a/src/tool_metalink.c
+++ b/src/tool_metalink.c
@@ -57,12 +57,13 @@
 #  ifdef HAVE_NSS_INITCONTEXT
      static NSSInitContext *nss_context;
 #  endif
-#elif defined(__MAC_10_4) || defined(__IPHONE_5_0)
+#elif __MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 || \
+      __IPHONE_OS_VERSION_MAX_ALLOWED >= 20000
 /* For Apple operating systems: 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
+   These functions are available on Tiger and later, as well as iOS 2.0
    and later. If you're building for an older cat, well, sorry. */
 #  define COMMON_DIGEST_FOR_OPENSSL
 #  include <CommonCrypto/CommonDigest.h>

