Index: trunk/psLib/src/fits/psFitsFloat.c
===================================================================
--- trunk/psLib/src/fits/psFitsFloat.c	(revision 16503)
+++ trunk/psLib/src/fits/psFitsFloat.c	(revision 16549)
@@ -1,7 +1,25 @@
+/*
+** Copyright (C) 2008 Institute for Astronomy, University of Hawaii
+**
+** This is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** The GNU C Library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with the GNU C Library; if not, write to the Free
+** Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+** 02111-1307 USA.
+*/
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include <ieee754.h>
 #include <string.h>
 #include <assert.h>
@@ -17,5 +35,4 @@
 #include "psFitsFloat.h"
 
-#define BIAS_FLOAT_16_0              10 // Exponent bias for FLOAT_16_0
 
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -23,19 +40,39 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+// This definition of IEEE754 floating-point, with some modifications, is from the GNU C Library, ieee754.h
+// Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
+union float_ieee754 {
+    float f;                            // Floating point
+    struct {                            // IEEE 754 single-precision format
+#ifdef WORDS_BIGENDIAN
+        unsigned int negative:1;
+        unsigned int exponent:8;
+        unsigned int mantissa:23;
+#else
+        unsigned int mantissa:23;
+        unsigned int exponent:8;
+        unsigned int negative:1;
+#endif
+    } ieee;
+};
+#define BIAS_FLOAT_IEEE754         0x7f // Exponent bias for IEEE754
+// End definition from ieee754.h
+
+
+// 16-bit floating point
 union float_16_0 {
-    psS16 s16;                      // 16-bit integer version
-
-    // Floating-point version
-    struct {
-        unsigned int negative:1;    // Sign bit
-        unsigned int exponent:5;    // Exponent bits
-        unsigned int mantissa:10;   // Mantissa bits
+    psS16 s16;                          // 16-bit integer version
+        struct {                        // Floating-point version
+        unsigned int negative:1;        // Sign bit
+        unsigned int exponent:5;        // Exponent bits
+        unsigned int mantissa:10;       // Mantissa bits
     } f16;
 };
+#define BIAS_FLOAT_16_0              10 // Exponent bias for FLOAT_16_0
 
 
 static inline psS16 convertF32toFloat16_0(psF32 value)
 {
-    union ieee754_float in;             // Input value
+    union float_ieee754 in;             // Input value
     union float_16_0 out;               // Output value
 
@@ -43,5 +80,5 @@
     in.f = value;
     out.f16.negative = in.ieee.negative;
-    out.f16.exponent = in.ieee.exponent - IEEE754_FLOAT_BIAS + BIAS_FLOAT_16_0;
+    out.f16.exponent = in.ieee.exponent - BIAS_FLOAT_IEEE754 + BIAS_FLOAT_16_0;
     out.f16.mantissa = in.ieee.mantissa >> 13;
 
@@ -52,9 +89,9 @@
 {
     union float_16_0 in;                // Input value
-    union ieee754_float out;            // Output value
+    union float_ieee754 out;            // Output value
 
     in.s16 = value;
     out.ieee.negative = in.f16.negative;
-    out.ieee.exponent = in.f16.exponent + IEEE754_FLOAT_BIAS - BIAS_FLOAT_16_0;
+    out.ieee.exponent = in.f16.exponent + BIAS_FLOAT_IEEE754 - BIAS_FLOAT_16_0;
     out.ieee.mantissa = in.f16.mantissa << 13;
 
