Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
301 B

#if defined(__GNUC__) && (__GNUC__ >= 5)
#include "uint16.h"
int imult16( int16 a, int16 b, int16* c) { return !__builtin_mul_overflow(a,b,c); }
#else
#include "safemult.h"
int imult16(int16 a,int16 b,int16* c) {
int32 x=(int32)a*b;
if ((int16)x != x) return 0;
*c=x;
return 1;
}
#endif