lib: IEC559 tests are fragile, reduce to warning rather than error.
* {network,stream}.c: Weaken the compile time tests for IEEE754 / IEC-559
binary floating point format from an error to a warning when not detected.
I can't think of any platforms that are not IEEE-754 format, and as the
testing for the defines appears to be fragile (often not set) the error
just gives false positives.
Even the warnings may be too much. Those should probably be moved
to some configure test. Will do for now though, to fix compilation
on CentOS and some BSDs.
diff --git a/lib/network.c b/lib/network.c
index b81d5f8..b982640 100644
--- a/lib/network.c
+++ b/lib/network.c
@@ -97,7 +97,9 @@
float
htonf (float host)
{
-#ifdef __STDC_IEC_559__
+#if !defined(__STDC_IEC_559__) && __GCC_IEC_559 < 0
+#warning "Unknown floating-point format on platform, htonf may break"
+#endif
u_int32_t lu1, lu2;
float convert;
@@ -105,9 +107,6 @@
lu2 = htonl (lu1);
memcpy (&convert, &lu2, sizeof (u_int32_t));
return convert;
-#else
-#error "Please supply htonf implementation for this platform"
-#endif
}
float