Support dtor sections on Mach-O.
[libfirm] / ir / tv / fltcalc.c
index 412bbd8..d6105a8 100644 (file)
  * @author   Mathias Heil
  * @version  $Id$
  */
-
 #include "config.h"
 
 #include "fltcalc.h"
 #include "strcalc.h"
 
-#include <math.h>    /* need isnan() and isinf() (will be changed)*/
+#include <math.h>
 /* undef some reused constants defined by math.h */
 #ifdef NAN
 #  undef NAN
 #endif
 
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
+#include <inttypes.h>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -1228,6 +1225,12 @@ fp_value *fc_cast(const fp_value *value, const ieee_descriptor_t *desc, fp_value
                else
                        return fc_get_snan(desc, result);
        }
+       else if(value->desc.clss == INF) {
+               if (value->sign == 0)
+                       return fc_get_plusinf(desc, result);
+               else
+                       return fc_get_minusinf(desc, result);
+       }
 
        /* set the descriptor of the new value */
        result->desc.exponent_size = desc->exponent_size;