#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)
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