Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2007-09-22 13:00:34


Author: johnmaddock
Date: 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
New Revision: 39478
URL: http://svn.boost.org/trac/boost/changeset/39478

Log:
Fixes for VC-7.1.
Added:
   sandbox/math_toolkit/libs/math/vc71_fix/
   sandbox/math_toolkit/libs/math/vc71_fix/Jamfile.v2 (contents, props changed)
   sandbox/math_toolkit/libs/math/vc71_fix/instantiate_all.cpp (contents, props changed)
Text files modified:
   sandbox/math_toolkit/boost/math/tools/config.hpp | 10 ++++++++++
   sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 2 ++
   sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp | 1 +
   sandbox/math_toolkit/libs/math/test/test_bessel_i.cpp | 2 ++
   sandbox/math_toolkit/libs/math/test/test_bessel_k.cpp | 2 ++
   sandbox/math_toolkit/libs/math/test/test_bessel_y.cpp | 2 ++
   sandbox/math_toolkit/libs/math/test/test_ellint_2.cpp | 2 ++
   sandbox/math_toolkit/libs/math/test/test_gamma.cpp | 4 ++++
   sandbox/math_toolkit/libs/math/test/test_hermite.cpp | 4 ++++
   sandbox/math_toolkit/libs/math/test/test_igamma.cpp | 4 ++++
   sandbox/math_toolkit/libs/math/test/test_igamma_inv.cpp | 4 ++++
   sandbox/math_toolkit/libs/math/test/test_igamma_inva.cpp | 2 ++
   sandbox/math_toolkit/libs/math/test/test_laguerre.cpp | 4 ++++
   sandbox/math_toolkit/libs/math/test/test_tgamma_ratio.cpp | 2 ++
   14 files changed, 45 insertions(+), 0 deletions(-)

Modified: sandbox/math_toolkit/boost/math/tools/config.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/config.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/config.hpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -3,6 +3,7 @@
 
 #include <boost/cstdint.hpp> // for boost::uintmax_t
 #include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
 #include <algorithm> // for min and max
 #include <cmath>
 
@@ -11,6 +12,15 @@
 #if defined(__CYGWIN__) || defined(__FreeBSD__)
 # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
 #endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+//
+// Define if constants too large for a float cause "bad"
+// values to be stored in the data, rather than infinity
+// or a suitably large value.
+//
+# define BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
+#endif
 //
 // Tune performance options for specific compilers:
 //

Modified: sandbox/math_toolkit/libs/math/test/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/test/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/test/Jamfile.v2 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -23,6 +23,7 @@
       <toolset>msvc:<cxxflags>/wd4510
       <toolset>msvc:<cxxflags>/wd4127
       <toolset>msvc:<cxxflags>/wd4701 # needed for lexical cast - temporary.
+ <toolset>msvc-7.1:<source>../vc71_fix//vc_fix
       # <toolset>msvc:<cxxflags>/wd4506 has no effect?
       # suppress xstring(237) : warning C4506: no definition for inline function
       <include>../../..
@@ -196,3 +197,4 @@
 
 
 
+

Modified: sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -154,6 +154,7 @@
    boost::math::legendre_next(2, 2, v1, v2, v3);
    boost::math::laguerre(1, v1);
    boost::math::laguerre(2, 1, v1);
+ boost::math::laguerre(2u, 1u, v1);
    boost::math::laguerre_next(2, v1, v2, v3);
    boost::math::laguerre_next(2, 1, v1, v2, v3);
    boost::math::hermite(1, v1);

Modified: sandbox/math_toolkit/libs/math/test/test_bessel_i.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_bessel_i.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_bessel_i.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -258,7 +258,9 @@
 #endif
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_bessel(0.1F, "float");
+#endif
    test_bessel(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_bessel(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_bessel_k.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_bessel_k.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_bessel_k.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -244,7 +244,9 @@
 #endif
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_bessel(0.1F, "float");
+#endif
    test_bessel(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_bessel(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_bessel_y.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_bessel_y.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_bessel_y.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -399,7 +399,9 @@
 #endif
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_bessel(0.1F, "float");
+#endif
    test_bessel(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_bessel(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_ellint_2.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_ellint_2.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_ellint_2.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -187,7 +187,9 @@
 int test_main(int, char* [])
 {
     expected_results();
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
     test_spots(0.0F, "float");
+#endif
     test_spots(0.0, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
     test_spots(0.0L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_gamma.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_gamma.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_gamma.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -431,14 +431,18 @@
 {
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_spots(0.0F);
+#endif
    test_spots(0.0);
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_spots(0.0L);
    test_spots(boost::math::concepts::real_concept(0.1));
 #endif
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_gamma(0.1F, "float");
+#endif
    test_gamma(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_gamma(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_hermite.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_hermite.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_hermite.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -173,7 +173,9 @@
 
 int test_main(int, char* [])
 {
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_spots(0.0F, "float");
+#endif
    test_spots(0.0, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_spots(0.0L, "long double");
@@ -182,7 +184,9 @@
 
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_hermite(0.1F, "float");
+#endif
    test_hermite(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_hermite(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_igamma.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_igamma.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_igamma.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -442,7 +442,9 @@
 {
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_spots(0.0F);
+#endif
    test_spots(0.0);
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_spots(0.0L);
@@ -451,7 +453,9 @@
 #endif
 #endif
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_gamma(0.1F, "float");
+#endif
    test_gamma(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_gamma(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_igamma_inv.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_igamma_inv.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_igamma_inv.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -365,7 +365,9 @@
 {
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_spots(0.0F, "float");
+#endif
    test_spots(0.0, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_spots(0.0L, "long double");
@@ -374,7 +376,9 @@
 #endif
 #endif
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_gamma(0.1F, "float");
+#endif
    test_gamma(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_gamma(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_igamma_inva.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_igamma_inva.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_igamma_inva.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -249,7 +249,9 @@
 {
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_gamma(0.1F, "float");
+#endif
    test_gamma(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_gamma(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_laguerre.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_laguerre.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_laguerre.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -256,7 +256,9 @@
 
 int test_main(int, char* [])
 {
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_spots(0.0F, "float");
+#endif
    test_spots(0.0, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_spots(0.0L, "long double");
@@ -265,7 +267,9 @@
 
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_laguerre(0.1F, "float");
+#endif
    test_laguerre(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_laguerre(0.1L, "long double");

Modified: sandbox/math_toolkit/libs/math/test/test_tgamma_ratio.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_tgamma_ratio.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_tgamma_ratio.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -203,7 +203,9 @@
 {
    expected_results();
 
+#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
    test_tgamma_ratio(0.1F, "float");
+#endif
    test_tgamma_ratio(0.1, "double");
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
    test_tgamma_ratio(0.1L, "long double");

Added: sandbox/math_toolkit/libs/math/vc71_fix/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/vc71_fix/Jamfile.v2 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -0,0 +1,6 @@
+# Copyright 2007 John Maddock and Paul A. Bristow.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+lib vc_fix : instantiate_all.cpp : <link>static ;
+

Added: sandbox/math_toolkit/libs/math/vc71_fix/instantiate_all.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/vc71_fix/instantiate_all.cpp 2007-09-22 13:00:29 EDT (Sat, 22 Sep 2007)
@@ -0,0 +1,29 @@
+// Copyright John Maddock 2006.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//
+// MSVC-7.1 has a problem with our tests: sometimes when a
+// function is used via a function pointer, it does *not*
+// instantiate the template, leading to unresolved externals
+// at link time. Therefore we create a small library that
+// instantiates "everything", and link all our tests against
+// it for msvc-7.1 only. Note that due to some BBv2 limitations
+// we can not place this in a sub-folder of the test directory
+// as that would lead to recursive project dependencies...
+//
+
+#include "../test/compile_test/instantiate.hpp"
+#include <boost/math/concepts/real_concept.hpp>
+
+void some_proc()
+{
+ instantiate(float(0));
+ instantiate(double(0));
+ instantiate(static_cast<long double>(0));
+ instantiate(static_cast<boost::math::concepts::real_concept>(0));
+}
+
+
+


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