X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCval.h;h=5348ec9814b1ad8371d97178268f8123a830fe8c;hb=c18a4cebda9c0f424821db515901d7357ea233a7;hp=bb49bee7eb9bd0da24f715f4200776b006bba6a7;hpb=a9f3838bdbedc49bb24f63070e0bef2e6fb5edea;p=fw%2Fsdcc diff --git a/src/SDCCval.h b/src/SDCCval.h index bb49bee7..5348ec98 100644 --- a/src/SDCCval.h +++ b/src/SDCCval.h @@ -32,11 +32,11 @@ * If the value of the integral part cannot be represented by the integer type, the behavior is undefined. * This shows up on Mac OS X i386 platform */ -/* - * on Mac OS X ppc (long) 2147483648.0 equals to 2147483647, so we explicitely convert it to 0x80000000 - * on other known platforms (long) 2147483648.0 equals to -2147483648 - */ -#define double2ul(val) ((val <= (double)0x80000000UL) ? 0x80000000UL : (((val) < 0) ? (unsigned long) -((long) -(val)) : (unsigned long) (val))) +#if defined(__APPLE__) && defined(__i386__) +#define double2ul(val) (((val) < 0) ? (unsigned long) -((long) -(val)) : (unsigned long) (val)) +#else +#define double2ul(val) ((unsigned long) (val)) +#endif /* value wrapper */ typedef struct value