[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] compilation problem in round_to_test.cpp
From: |
Vadim Zeitlin |
Subject: |
[lmi] compilation problem in round_to_test.cpp |
Date: |
Mon, 2 Jun 2008 01:25:28 +0200 |
Sorry for the avalanche of problems but they just seem to keep coming
tonight: this time there is a problem with the (re)definition of
e_ieee754_rounding enum in round_to_test.cpp -- g++ (correctly) complains
that it is already defined in fenv_lmi_x86.hpp.
I think the reason this problem isn't seen under Windows must be that
__STDC_IEC_559__ is not defined by the version of mingw32 used there as
otherwise I don't know how could it compile. But in any case this change
is at least consistent with fenv_lmi.hpp and does fix compilation of the
test for me:
--- round_to_test.cpp 2008-03-31 02:22:24 +0000
+++ round_to_test.cpp 2008-06-01 23:20:41 +0000
@@ -37,7 +37,9 @@
#include <iostream>
#include <ostream>
-#ifdef __STDC_IEC_559__
+#if defined LMI_X86
+ // "fenv_lmi_x86.hpp" provides the necessary values.
+#elif defined __STDC_IEC_559__
// In case the C++ compiler offers C99 fesetround(), assume that
// it defines __STDC_IEC_559__, but doesn't support
// #pragma STDC FENV_ACCESS ON
@@ -49,8 +51,6 @@
,fe_upward = FE_UPWARD
,fe_towardzero = FE_TOWARDZERO
};
-#elif defined LMI_X86
- // "fenv_lmi_x86.hpp" provides the necessary values.
#else // No known way to set rounding style.
# error No known way to set rounding style.
#endif // No known way to set rounding style.
(although it's not totally clear from the diff, this patch simply changes
the order of __STDC_IEC_559__ and LMI_X86 checks).
As before, please let me know if you want me to apply this directly or if
you prefer to take care of this yourself.
Thanks,
VZ
- [lmi] compilation problem in round_to_test.cpp,
Vadim Zeitlin <=