From 3ac1c3ed595cacdc050d6bb273c69fb3c30abf7f Mon Sep 17 00:00:00 2001 From: borutr Date: Sun, 30 Sep 2007 10:35:11 +0000 Subject: [PATCH] * src/SDCCval.h: fixed bug #1739860 - sdcc does not work correctly on some platforms git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4923 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCval.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.30.2