platforms
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4923
4a8a32a2-be11-0410-ad9d-
d568d2c75423
* 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