forked from boostorg/config
Compare commits
1 Commits
boost-1.22
...
boost-1.21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c29d67dcd |
@@ -1,4 +1,4 @@
|
||||
// Boost config.hpp configuration test program file -----------------------//
|
||||
// Boost config.hpp configuration test program file ------------------------------//
|
||||
|
||||
// (C) Copyright Boost.org 2000. Permission to copy, use, modify, sell and
|
||||
// distribute this software is granted provided this copyright notice appears
|
||||
@@ -11,14 +11,10 @@
|
||||
#include <iostream>
|
||||
|
||||
using std::cout;
|
||||
using std::hex;
|
||||
using std::dec;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
// boost compiler workaround defines
|
||||
|
||||
# ifdef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
cout << "BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS defined\n";
|
||||
# endif
|
||||
@@ -67,37 +63,10 @@ int main()
|
||||
cout << "BOOST_SYSTEM_HAS_STDINT_H defined\n";
|
||||
# endif
|
||||
|
||||
|
||||
// compilers
|
||||
|
||||
# ifdef __GNUC__
|
||||
cout << "__GNUC__ defined as " << __GNUC__ << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __GNUC_MINOR__
|
||||
cout << "__GNUC_MINOR__ defined as " << __GNUC_MINOR__ << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __EDG_VERSION__
|
||||
cout << "__EDG_VERSION__ defined as " << __EDG_VERSION__ << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __ICC
|
||||
cout << "__ICC defined as " << __ICC << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __ICL
|
||||
cout << "__ICL defined as " << __ICL << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __INTEL_COMPILER
|
||||
cout << "__INTEL_COMPILER defined as " << __INTEL_COMPILER << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __USLC__
|
||||
cout << "__USLC__ defined\n";
|
||||
# endif
|
||||
|
||||
# ifdef __BORLANDC__
|
||||
cout << "__BORLANDC__ defined as " << __BORLANDC__ << "\n";
|
||||
# endif
|
||||
@@ -110,20 +79,6 @@ int main()
|
||||
cout << "__SUNPRO_CC defined as " << __SUNPRO_CC << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __sgi
|
||||
cout << "__sgi is defined\n";
|
||||
# ifdef _COMPILER_VERSION
|
||||
cout << "_COMPILER_VERSION defined as " << _COMPILER_VERSION << "\n";
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef __DECCXX
|
||||
cout << "__DECCXX defined\n";
|
||||
# ifdef __DECCXX_VER
|
||||
cout << "__DECCXX_VER defined as " << __DECCXX_VER << "\n";
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef _MSC_VER
|
||||
cout << "_MSC_VER defined as " << _MSC_VER << "\n";
|
||||
# endif
|
||||
@@ -140,28 +95,8 @@ int main()
|
||||
cout << "BOOST_MSVC_STD_ITERATOR defined\n";
|
||||
# endif
|
||||
|
||||
|
||||
// libraries
|
||||
|
||||
# ifdef __SGI_STL_PORT
|
||||
cout << "__SGI_STL_PORT defined as 0x"
|
||||
<< hex << __SGI_STL_PORT << dec << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef __GLIBCPP__
|
||||
cout << "__GLIBCPP__ defined\n";
|
||||
# endif
|
||||
|
||||
# ifdef _GLIBCPP_VERSION
|
||||
cout << "_GLIBCPP_VERSION defined as " << _GLIBCPP_VERSION << "\n";
|
||||
# endif
|
||||
|
||||
# ifdef _GLIBCPP_USE_LONG_LONG
|
||||
cout << "_GLIBCPP_USE_LONG_LONG defined\n";
|
||||
# endif
|
||||
|
||||
# ifdef _GLIBCPP_USE_WCHAR_T
|
||||
cout << "_GLIBCPP_USE_WCHAR_T defined\n";
|
||||
cout << "__SGI_STL_PORT defined\n";
|
||||
# endif
|
||||
|
||||
# ifdef __STL_NO_NAMESPACES
|
||||
@@ -176,9 +111,5 @@ int main()
|
||||
cout << "__STL_IMPORT_VENDOR_CSTD defined\n";
|
||||
# endif
|
||||
|
||||
# ifdef _RWSTD_VER
|
||||
cout << "_RWSTD_VER defined as " << _RWSTD_VER << "\n";
|
||||
# endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#ifndef BOOST_CONFIG_HPP
|
||||
#define BOOST_CONFIG_HPP
|
||||
|
||||
#define BOOST_VERSION 102200
|
||||
#define BOOST_VERSION 102102
|
||||
|
||||
// BOOST_VERSION % 100 is the sub-minor version
|
||||
// BOOST_VERSION / 100 % 1000 is the minor version
|
||||
@@ -263,16 +263,7 @@
|
||||
# endif
|
||||
# endif
|
||||
|
||||
// Intel on Linux ---------------------------------------------------------
|
||||
|
||||
#elif defined __ICC
|
||||
# include <iterator>
|
||||
# ifdef _CPPLIB_VER
|
||||
// shipped with Dinkumware 3.10, which has a different hash_map
|
||||
# define BOOST_NO_HASH
|
||||
# endif
|
||||
|
||||
// Kai C++ ----------------------------------------------------------------
|
||||
// Kai C++ ------------------------------------------------------------------//
|
||||
|
||||
#elif defined __KCC
|
||||
# define BOOST_NO_SLIST
|
||||
@@ -338,7 +329,7 @@
|
||||
# define BOOST_NO_CV_SPECIALIZATIONS
|
||||
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
|
||||
// Intel on Windows --------------------------------------------------------//
|
||||
// Intel -------------------------------------------------------------------//
|
||||
|
||||
# elif defined __ICL
|
||||
# include <iterator> // not sure this is the right way to do this -JGS
|
||||
@@ -346,13 +337,6 @@
|
||||
// a perfectly good implementation of std::iterator is supplied
|
||||
# elif defined(__SGI_STL_ITERATOR)
|
||||
# define BOOST_NO_STD_ITERATOR // No std::iterator in this case
|
||||
# elif defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
|
||||
# // full dinkumware 3.06 and above
|
||||
# define BOOST_NO_HASH
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
# if !_GLOBAL_USING // can be defined in yvals.h
|
||||
# define BOOST_NO_STDC_NAMESPACE
|
||||
# endif
|
||||
# else // assume using dinkumware's STL that comes with VC++ 6.0
|
||||
# define BOOST_MSVC_STD_ITERATOR
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
@@ -368,7 +352,7 @@
|
||||
// Metrowerks CodeWarrior --------------------------------------------------//
|
||||
|
||||
# elif defined __MWERKS__
|
||||
# if __MWERKS__ <= 0x2401 // 6.2
|
||||
# if __MWERKS__ <= 0x2400 // 6.0
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
# endif
|
||||
# if __MWERKS__ <= 0x2301 // 5.3?
|
||||
@@ -391,41 +375,20 @@
|
||||
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE Metrowerks
|
||||
|
||||
// Sun Workshop Compiler C++ ------------------------------------------------
|
||||
// Sun Workshop Compiler C++ ------------------------------------------------//
|
||||
|
||||
# elif defined __SUNPRO_CC
|
||||
# if __SUNPRO_CC <= 0x520
|
||||
# define BOOST_NO_SLIST
|
||||
# define BOOST_NO_HASH
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
// although sunpro 5.1 supports the syntax for
|
||||
// inline initialization it often gets the value
|
||||
// wrong, especially where the value is computed
|
||||
// from other constants (J Maddock 6th May 2001)
|
||||
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
|
||||
// although sunpro 5.1 supports the syntax for
|
||||
// partial specialization, it often seems to
|
||||
// bind to the wrong specialization. Better
|
||||
// to disable it until suppport becomes more stable
|
||||
// (J Maddock 6th May 2001).
|
||||
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# endif
|
||||
# if __SUNPRO_CC <= 0x500
|
||||
# define BOOST_NO_MEMBER_TEMPLATES
|
||||
# define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
# endif
|
||||
|
||||
|
||||
// HP aCC -------------------------------------------------------------------
|
||||
|
||||
# elif defined __HP_aCC
|
||||
# define BOOST_NO_SLIST
|
||||
# define BOOST_NO_HASH
|
||||
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
|
||||
# define BOOST_NO_OPERATORS_IN_NAMESPACE
|
||||
// (support for HP aCC is not complete, see the regression test results)
|
||||
|
||||
// Microsoft Visual C++ (excluding Intel/EDG front end) --------------------
|
||||
// Microsoft Visual C++ (excluding Intel/EDG front end) --------------------//
|
||||
//
|
||||
// Must remain the last #elif since some other vendors (Metrowerks, for
|
||||
// example) also #define _MSC_VER
|
||||
@@ -460,13 +423,6 @@
|
||||
// a perfectly good implementation of std::iterator is supplied
|
||||
# elif defined(__SGI_STL_ITERATOR)
|
||||
# define BOOST_NO_STD_ITERATOR // No std::iterator in this case
|
||||
# elif defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
|
||||
// full dinkumware 3.06 and above
|
||||
# define BOOST_NO_HASH
|
||||
# define BOOST_NO_STD_ITERATOR_TRAITS
|
||||
# ifndef _GLOBAL_USING // can be defined in yvals.h
|
||||
# define BOOST_NO_STDC_NAMESPACE
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_MSVC_STD_ITERATOR 1
|
||||
# define BOOST_NO_SLIST
|
||||
@@ -521,7 +477,7 @@
|
||||
|
||||
// end of compiler specific portion ----------------------------------------//
|
||||
|
||||
#if defined(BOOST_NO_LIMITS) || (defined(_RWSTD_VER) && defined(__BORLANDC__) && _RWSTD_VER < 0x020300) || (defined(__SGI_STL_PORT) && __SGI_STL_PORT <= 0x410 && defined(__STL_STATIC_CONST_INIT_BUG))
|
||||
#if defined(BOOST_NO_LIMITS) || (defined(_RWSTD_VER) && defined(__BORLANDC__) && _RWSTD_VER < 0x020300) || (defined(__SGI_STL_PORT) && __SGI_STL_PORT <= 0x410 && __STL_STATIC_CONST_INIT_BUG)
|
||||
// STLPort 4.0 doesn't define the static constants in numeric_limits<> so that they
|
||||
// can be used at compile time if the compiler bug indicated by
|
||||
// __STL_STATIC_CONST_INIT_BUG is present.
|
||||
@@ -532,11 +488,6 @@
|
||||
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
#endif
|
||||
|
||||
#if defined(__hpux)
|
||||
// HP-UX has a nice stdint.h in a different location, see boost/cstdint.hpp
|
||||
# define BOOST_SYSTEM_HAS_STDINT_H
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_STD_EXTENSION_NAMESPACE
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE std
|
||||
#endif
|
||||
@@ -599,6 +550,3 @@ namespace std {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include <cfloat>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(__sparc) || defined(__sparc__) || defined(__powerpc__) || defined(__hppa)
|
||||
#if defined(__sparc) || defined(__sparc__) || defined(__powerpc__)
|
||||
#define BOOST_BIG_ENDIAN
|
||||
#elif !defined(__i386__)
|
||||
#error The file boost/detail/limits.hpp needs to be set up for your CPU type.
|
||||
#error This file is not correctly set up for your cpu type.
|
||||
#endif
|
||||
|
||||
namespace std {
|
||||
@@ -268,13 +268,12 @@ class numeric_limits<unsigned char>
|
||||
: public _Integer_limits<unsigned char, 0, UCHAR_MAX>
|
||||
{};
|
||||
|
||||
#if !defined(_WIN32) && !defined(__CYGWIN__)
|
||||
#ifndef _WIN32
|
||||
template<>
|
||||
class numeric_limits<wchar_t>
|
||||
: public _Integer_limits<wchar_t, INT_MIN, INT_MAX>
|
||||
{};
|
||||
#else
|
||||
template<>
|
||||
class numeric_limits<wchar_t>
|
||||
: public _Integer_limits<wchar_t, 0, USHRT_MAX>
|
||||
{};
|
||||
|
||||
@@ -79,10 +79,8 @@ be self documenting.</p>
|
||||
<h2>Test program</h2>
|
||||
<p>The <a href="config_test.cpp">config_test.cpp</a> program can be used to
|
||||
verify which #defines are in effect for your compiler.</p>
|
||||
<p>The <a href="limits_test.cpp">limits_test.cpp</a> program can also be helpful
|
||||
in diagnosing configuration problems.</p>
|
||||
<hr>
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->22 May 2001<!--webbot bot="Timestamp" endspan i-checksum="15106" --></p>
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan -->10 Nov 2000<!--webbot bot="Timestamp" endspan i-checksum="15233" --></p>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
@@ -66,10 +66,18 @@ void test_float_limits(const T &, const char * msg)
|
||||
BOOST_TEST(!lim::is_integer);
|
||||
BOOST_TEST(lim::is_signed);
|
||||
|
||||
BOOST_TEST(lim::epsilon() > 0);
|
||||
|
||||
BOOST_TEST(lim::has_infinity);
|
||||
BOOST_TEST(lim::has_quiet_NaN);
|
||||
BOOST_TEST(lim::has_signaling_NaN);
|
||||
|
||||
const T infinity = lim::infinity();
|
||||
const T qnan = lim::quiet_NaN();
|
||||
const T snan = lim::signaling_NaN();
|
||||
|
||||
// make sure those values are not 0 or similar nonsense
|
||||
|
||||
std::cout << "IEEE-compatible: " << lim::is_iec559
|
||||
<< ", traps: " << lim::traps
|
||||
<< ", bounded: " << lim::is_bounded
|
||||
@@ -81,44 +89,25 @@ void test_float_limits(const T &, const char * msg)
|
||||
print_hex_val(qnan, "qnan");
|
||||
print_hex_val(snan, "snan");
|
||||
|
||||
// infinity is beyond the representable range
|
||||
BOOST_TEST(lim::max() > 1000);
|
||||
BOOST_TEST(lim::min() > 0);
|
||||
BOOST_TEST(lim::infinity() > lim::max());
|
||||
BOOST_TEST(-lim::infinity() < -lim::max());
|
||||
BOOST_TEST(lim::min() < 0.001);
|
||||
BOOST_TEST(lim::epsilon() > 0);
|
||||
BOOST_TEST(lim::min() > 0);
|
||||
|
||||
if(lim::is_iec559) {
|
||||
BOOST_TEST(lim::has_infinity);
|
||||
BOOST_TEST(lim::has_quiet_NaN);
|
||||
BOOST_TEST(lim::has_signaling_NaN);
|
||||
} else {
|
||||
std::cout << "Does not claim IEEE conformance" << std::endl;
|
||||
}
|
||||
// NaNs shall always compare "false" when compared for equality
|
||||
// If one of these fail, your compiler may be optimizing incorrectly
|
||||
BOOST_TEST(! (qnan == 42));
|
||||
BOOST_TEST(! (qnan == qnan));
|
||||
BOOST_TEST(qnan != 42);
|
||||
BOOST_TEST(qnan != qnan);
|
||||
|
||||
if(lim::has_infinity) {
|
||||
// make sure those values are not 0 or similar nonsense
|
||||
// infinity is beyond the representable range
|
||||
BOOST_TEST(infinity > lim::max());
|
||||
BOOST_TEST(-infinity < -lim::max());
|
||||
} else {
|
||||
std::cout << "Does not have infinity" << std::endl;
|
||||
}
|
||||
|
||||
if(lim::has_quiet_NaN) {
|
||||
// NaNs shall always compare "false" when compared for equality
|
||||
// If one of these fail, your compiler may be optimizing incorrectly
|
||||
BOOST_TEST(! (qnan == 42));
|
||||
BOOST_TEST(! (qnan == qnan));
|
||||
BOOST_TEST(qnan != 42);
|
||||
BOOST_TEST(qnan != qnan);
|
||||
|
||||
// The following tests may cause arithmetic traps etc. Avoid for now.
|
||||
// BOOST_TEST(! (qnan < 42));
|
||||
// BOOST_TEST(! (qnan > 42));
|
||||
// BOOST_TEST(! (qnan <= 42));
|
||||
// BOOST_TEST(! (qnan >= 42));
|
||||
} else {
|
||||
std::cout << "Does not have QNaN" << std::endl;
|
||||
}
|
||||
// The following tests may cause arithmetic traps etc. Avoid for now.
|
||||
// BOOST_TEST(! (qnan < 42));
|
||||
// BOOST_TEST(! (qnan > 42));
|
||||
// BOOST_TEST(! (qnan <= 42));
|
||||
// BOOST_TEST(! (qnan >= 42));
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +129,7 @@ int test_main(int, char*[])
|
||||
test_integral_limits(long(), "long");
|
||||
typedef unsigned long unsigned_long;
|
||||
test_integral_limits(unsigned_long(), "unsigned long");
|
||||
#if defined(__GNUC__) && !(__GNUC__ == 3 && __GNUC_MINOR__ == 0 && defined(__GLIBCPP__))
|
||||
#ifdef __GNUC__
|
||||
typedef long long long_long;
|
||||
test_integral_limits(long_long(), "long long");
|
||||
typedef unsigned long long unsigned_long_long;
|
||||
|
||||
Reference in New Issue
Block a user