Use <error_unimplemented_primitive> in case uint64 is not available.
authorArthur A. Gleckler <gnu@speechcode.com>
Tue, 7 Sep 2010 15:03:28 +0000 (08:03 -0700)
committerArthur A. Gleckler <gnu@speechcode.com>
Tue, 7 Sep 2010 15:03:28 +0000 (08:03 -0700)
src/microcode/flonum.c

index c61e00f747268bed2160514d0b538de3593ad8e0..83c18f19d2d974a7893d4c6a658afc7bf42cd780 100644 (file)
@@ -274,10 +274,12 @@ union
   double dbl;
   uint64_t u64;
 } double_uint64_t_cast;
+#endif
 
 DEFINE_PRIMITIVE ("CAST-IEEE754-DOUBLE-TO-INTEGER", Prim_cast_ieee754_double_to_integer, 1, 1, 0)
 {
   PRIMITIVE_HEADER (1);
+#if defined UINT64_MAX || defined uint64_t
   CHECK_ARG (1, FLONUM_P);
 
   double_uint64_t_cast cast;
@@ -285,11 +287,16 @@ DEFINE_PRIMITIVE ("CAST-IEEE754-DOUBLE-TO-INTEGER", Prim_cast_ieee754_double_to_
   cast.dbl = FLONUM_TO_DOUBLE (ARG_REF (1));
 
   PRIMITIVE_RETURN (uintmax_to_integer (cast.u64));
+#else
+  error_unimplemented_primitive ();
+  PRIMITIVE_RETURN (UNSPECIFIC);
+#endif
 }
 
 DEFINE_PRIMITIVE ("CAST-INTEGER-TO-IEEE754-DOUBLE", Prim_cast_integer_to_ieee754_double, 1, 1, 0)
 {
   PRIMITIVE_HEADER (1);
+#if defined UINT64_MAX || defined uint64_t
   CHECK_ARG (1, INTEGER_P);
 
   double_uint64_t_cast cast;
@@ -297,8 +304,11 @@ DEFINE_PRIMITIVE ("CAST-INTEGER-TO-IEEE754-DOUBLE", Prim_cast_integer_to_ieee754
   cast.u64 = integer_to_uintmax (ARG_REF (1));
 
   PRIMITIVE_RETURN (double_to_flonum (cast.dbl));
-}
+#else
+  error_unimplemented_primitive ();
+  PRIMITIVE_RETURN (UNSPECIFIC);
 #endif
+}
 
 typedef
 union