Don't use inline assembler on x86 Solaris (would need a different syntax).
[openssl.git] / crypto / bn / bn_div.c
index 6dd5d99ec4a8fac27d17b0db329d315c5d4ad86f..36beea2296b822901cb27f47380704daa444eb9a 100644 (file)
@@ -207,7 +207,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 
 #if !defined(NO_ASM) && !defined(PEDANTIC)
 # if defined(__GNUC__) && __GNUC__>=2
-#  if defined(__i386)
+#  if defined(__i386) && !defined(__sun)
    /*
     * There were two reasons for implementing this template:
     * - GNU C generates a call to a function (__udivdi3 to be exact)
@@ -238,7 +238,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
                        q=BN_MASK2;
                else
 #if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)
-                       q=((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0;
+                       q=(BN_ULONG)(((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0);
 #else
                        q=bn_div_words(n0,n1,d0);
 #endif