X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=support%2Fregression%2Ftests%2Flibmullong.c;h=efe0c816c96ca7336ffde6e96b74160d3876f7e5;hb=f3946e669d77d841b638d798c3e09429cd3338c6;hp=61ead68b4212cda24ecc0559781fb0b96c77aa61;hpb=c4e2d5daae13c63de360bc8b9a60a0667b8c536a;p=fw%2Fsdcc diff --git a/support/regression/tests/libmullong.c b/support/regression/tests/libmullong.c index 61ead68b..efe0c816 100644 --- a/support/regression/tests/libmullong.c +++ b/support/regression/tests/libmullong.c @@ -15,7 +15,7 @@ # include "../../../../../device/lib/_mullong.c" # define mullong(a,b) mullong_wrapper(a,b) # else -# define mullong(a,b) (a*b) +# define mullong(a,b) mullong_wrapper(a,b) # endif #else # if defined(type_c) @@ -28,7 +28,9 @@ /* gcc 2.95.2 on usf-cf-x86-linux-1 (debian 2.2) has a bug with * packing structs */ -#if defined(PORT_HOST) && defined(type_c) && !defined(WORDS_BIGENDIAN) +#if defined(PORT_HOST) + +#if defined(type_c) && !defined(WORDS_BIGENDIAN) struct { char c1; @@ -43,9 +45,23 @@ mullong_wrapper (long a, long b) /* length of struct ok: use SDCC library */ return _mullong (a, b); else - /* buggy gcc: use generic multiplication */ + { + /* buggy gcc: use generic multiplication */ + return a * b; + } +} +#endif + +#if defined(WORDS_BIGENDIAN) + +long +mullong_wrapper (long a, long b) +{ return a * b; } + +#endif + #endif void