mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Fixes for VC-7.1.
[SVN r39478]
This commit is contained in:
@@ -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:
|
||||
//
|
||||
|
||||
@@ -23,6 +23,7 @@ project
|
||||
<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 @@ compile compile_test/tools_toms748_solve_inc_test.cpp ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ void instantiate(RealType)
|
||||
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);
|
||||
|
||||
@@ -258,7 +258,9 @@ int test_main(int, char* [])
|
||||
#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");
|
||||
|
||||
@@ -244,7 +244,9 @@ int test_main(int, char* [])
|
||||
#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");
|
||||
|
||||
@@ -399,7 +399,9 @@ int test_main(int, char* [])
|
||||
#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");
|
||||
|
||||
@@ -187,7 +187,9 @@ void test_spots(T, const char* type_name)
|
||||
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");
|
||||
|
||||
@@ -431,14 +431,18 @@ int test_main(int, char* [])
|
||||
{
|
||||
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");
|
||||
|
||||
@@ -173,7 +173,9 @@ void test_spots(T, const char* t)
|
||||
|
||||
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 @@ int test_main(int, char* [])
|
||||
|
||||
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");
|
||||
|
||||
@@ -442,7 +442,9 @@ int test_main(int, char* [])
|
||||
{
|
||||
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 @@ int test_main(int, char* [])
|
||||
#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");
|
||||
|
||||
@@ -365,7 +365,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");
|
||||
@@ -374,7 +376,9 @@ int test_main(int, char* [])
|
||||
#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");
|
||||
|
||||
@@ -249,7 +249,9 @@ int test_main(int, char* [])
|
||||
{
|
||||
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");
|
||||
|
||||
@@ -256,7 +256,9 @@ void test_spots(T, const char* t)
|
||||
|
||||
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 @@ int test_main(int, char* [])
|
||||
|
||||
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");
|
||||
|
||||
@@ -203,7 +203,9 @@ int test_main(int, char* [])
|
||||
{
|
||||
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");
|
||||
|
||||
6
vc71_fix/Jamfile.v2
Normal file
6
vc71_fix/Jamfile.v2
Normal file
@@ -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 ;
|
||||
|
||||
29
vc71_fix/instantiate_all.cpp
Normal file
29
vc71_fix/instantiate_all.cpp
Normal file
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user