|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70202 - trunk/libs/config/test
From: john_at_[hidden]
Date: 2011-03-19 13:57:16
Author: johnmaddock
Date: 2011-03-19 13:57:16 EDT (Sat, 19 Mar 2011)
New Revision: 70202
URL: http://svn.boost.org/trac/boost/changeset/70202
Log:
Don't take the address of extern "C" functions: some compilers (PGI for example) don't allow mixing pointers to extern "C" and pointers to extern "C++". Actually call the functions instead and make sure they all work as advertised.
Text files modified:
trunk/libs/config/test/boost_no_fenv_h.ipp | 28 ++++++++++++++++------------
1 files changed, 16 insertions(+), 12 deletions(-)
Modified: trunk/libs/config/test/boost_no_fenv_h.ipp
==============================================================================
--- trunk/libs/config/test/boost_no_fenv_h.ipp (original)
+++ trunk/libs/config/test/boost_no_fenv_h.ipp 2011-03-19 13:57:16 EDT (Sat, 19 Mar 2011)
@@ -34,20 +34,24 @@
#if !defined(FE_ALL_EXCEPT)
#error platform does not define FE_ALL_EXCEPT
#endif
+
+ int i;
+ fexcept_t fe;
+ fenv_t env;
- int (*has_feclearexcept)(int ) = ::feclearexcept;
- int (*has_fegetexceptflag)(fexcept_t *, int ) = fegetexceptflag;
- int (*has_feraiseexcept)(int ) = feraiseexcept;
- int (*has_fesetexceptflag)(const fexcept_t *, int ) = fesetexceptflag;
- int (*has_fetestexcept)(int ) = fetestexcept;
- int (*has_fegetround)(void) = fegetround;
- int (*has_fesetround)(int ) = fesetround;
- int (*has_fegetenv)(fenv_t *) = fegetenv;
- int (*has_feholdexcept)(fenv_t *) = feholdexcept;
- int (*has_fesetenv)(const fenv_t *) = fesetenv;
- int (*has_feupdateenv)(const fenv_t *) = feupdateenv;
+ i = feclearexcept(FE_ALL_EXCEPT);
+ i += fetestexcept(FE_ALL_EXCEPT); // All flags should be zero
+ i += fegetexceptflag(&fe, FE_ALL_EXCEPT);
+ i += fesetexceptflag(&fe, FE_ALL_EXCEPT);
+ i += feraiseexcept(0);
+ i += fesetround(fegetround());
+ i += fegetenv(&env);
+ i += fesetenv(&env);
+ i += feholdexcept(&env);
+ if(i)
+ i += feupdateenv(&env);
- return 0;
+ return i;
}
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk