* src/SDCCval.h: fixed bug #1739860 - sdcc does not work correctly on some
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 30 Sep 2007 10:35:11 +0000 (10:35 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 30 Sep 2007 10:35:11 +0000 (10:35 +0000)
  platforms

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4923 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCval.h

index bb49bee7eb9bd0da24f715f4200776b006bba6a7..5348ec9814b1ad8371d97178268f8123a830fe8c 100644 (file)
  * 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