From 2eea29238c0b87fb428601d5163b5fbfc403fae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Fri, 14 Mar 2014 18:23:26 +0100 Subject: [PATCH] Make the compiler work-around more specific --- library/bignum.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/library/bignum.c b/library/bignum.c index d9a22c1dd..6d49caab5 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -1233,13 +1233,16 @@ int mpi_div_mpi( mpi *Q, mpi *R, const mpi *A, const mpi *B ) else { /* - * The version of Clang shipped by Apple with Mavericks can't - * handle 128-bit division properly. Disable 128-bits division - * for Clang on Apple for now, while waiting for more input on the - * exact version(s) affected and their identification macros. + * The version of Clang shipped by Apple with Mavericks around + * 2014-03 can't handle 128-bit division properly. Disable + * 128-bits division for this version. Let's be optimistic and + * assume it'll be fixed in the next minor version (next + * patchlevel is probably a bit too optimistic). */ -#if defined(POLARSSL_HAVE_UDBL) && \ - ! ( defined(__x86_64__) && defined(__clang__) && defined(__APPLE__) ) +#if defined(POLARSSL_HAVE_UDBL) && \ + ! ( defined(__x86_64__) && defined(__APPLE__) && \ + defined(__clang_major__) && __clang_major__ == 5 && \ + defined(__clang_minor__) && __clang_minor__ == 0 ) t_udbl r; r = (t_udbl) X.p[i] << biL;