Commits

Anonymous committed 7adb8bd

src/FloatPacker.cxx
Hack ieee754_double definition for MacOSX. There's probably a better way of doing this
src/SealDebug.cxx
Remove #include <malloc.h> for MacOSX since it's missing (and not needed)

David Quarrie

Comments (0)

Files changed (3)

+2010-01-10  David Quarrie <David.Quarrie>
+
+	* Tagging CxxUtils-00-00-46.
+	* src/FloatPackage.cxx: Hack ieee754_double definition for MacOSX. There's probably a better way of doing this
+	* src/SealDebug.cxx: Remove #include <malloc.h> for MacOSX since it's missing (and not needed)
+
 2010-01-09  scott snyder  <snyder@bnl.gov>
 
 	* Tagging CxxUtils-00-00-45.

src/FloatPacker.cxx

 #include <string>
 #include <sstream>
 #include <iomanip>
+#ifndef __APPLE__
 #include <ieee754.h>  // ??? Is this standardized?
+#else
+//ieee754.h doesn't exist on MacOSX
+union ieee754_double
+{
+  long double d;
+  struct {
+    unsigned int negative:1;
+    unsigned int exponent:11;
+    /* Together these comprise the mantissa.  */
+    unsigned int mantissa0:20;
+    unsigned int mantissa1:32;
+  } ieee;
+  struct {
+    unsigned int negative:1;
+    unsigned int exponent:11;
+    unsigned int quiet_nan:1;
+    /* Together these comprise the mantissa.  */
+    unsigned int mantissa0:19;
+    unsigned int mantissa1:32;
+  } ieee_nan;
+};
+
+#define IEEE754_DOUBLE_BIAS  0x3ff /* Added to exponent.  */
+
+#endif
 #include <stdint.h>
 
 

src/SealDebug.cxx

 #if HAVE_BACKTRACE_SYMBOLS_FD && HAVE_DLADDR
 // sss
 #include <unistd.h>
+#ifndef __APPLE__
 #include <malloc.h>
+#endif
 #include <errno.h>
 namespace {