fix for 32-bit archs

master
leitner 16 years ago
parent 3629bfd5a7
commit 10ab3bf70a

@ -22,6 +22,16 @@ void imult64() {
#include "safemult.h"
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__) || defined(__powerpc64__) || defined(__alpha__) || defined(__mips64__) || defined(__sparc64__))
int imult64(int64 a,int64 b,int64* c) {
__int128_t x=((__int128_t)a)*b;
if ((*c=(int64)x) != x) return 0;
return 1;
}
#else
int imult64(int64 a,int64 b,int64* c) {
int neg=(a<0);
uint64 d;
@ -34,3 +44,5 @@ int imult64(int64 a,int64 b,int64* c) {
}
#endif
#endif

@ -21,7 +21,7 @@ void umult64() {
#include "safemult.h"
#ifdef __GNUC__
#if defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__) || defined(__powerpc64__) || defined(__alpha__) || defined(__mips64__) || defined(__sparc64__))
int umult64(uint64 a,uint64 b,uint64* c) {
__uint128_t x=((__uint128_t)a)*b;

Loading…
Cancel
Save