Compare commits

...

9 Commits

Author SHA1 Message Date
fcd3688fcd This commit was manufactured by cvs2svn to create branch
'python-v2-dev'.

[SVN r14785]
2002-08-12 13:35:54 +00:00
344fe9f30a clear un/signed warnings
[SVN r14692]
2002-08-05 11:16:14 +00:00
8ad3bbafbc BOOST_HAS_MS_INT64 rather than specific compilers
[SVN r14668]
2002-08-05 00:02:10 +00:00
cc1183d347 Check for BOOST_HAS_MS_INT64 instead of specific compilers
[SVN r14664]
2002-08-04 01:27:24 +00:00
a9703fa803 Fix link
[SVN r14630]
2002-07-27 20:08:51 +00:00
5e26f47535 Fixed test case for VC7.0
[SVN r14627]
2002-07-27 11:47:04 +00:00
57e7ccd494 Fix unversioned VC++ checks
[SVN r14436]
2002-07-13 12:26:19 +00:00
c56e4674f8 Update from Daryle
[SVN r14187]
2002-06-19 20:11:17 +00:00
41620a14f9 Patched so that the code now compilers with VC6
[SVN r13669]
2002-05-05 11:00:28 +00:00
6 changed files with 75 additions and 14 deletions

View File

@ -99,8 +99,8 @@ void integral_constant_type_check(T1, T2)
// numeric_limits implementations currently
// vary too much, or are incomplete or missing.
//
T1 t1 = -1;
T2 t2 = -1;
T1 t1 = static_cast<T1>(-1); // cast suppresses warnings
T2 t2 = static_cast<T2>(-1); // ditto
#if defined(BOOST_HAS_STDINT_H)
// if we have a native stdint.h
// then the INTXX_C macros may define
@ -110,10 +110,10 @@ void integral_constant_type_check(T1, T2)
assert(sizeof(T1) == sizeof(T2));
assert(t1 == t2);
#endif
if(t1 >= 0)
assert(t2 >= 0);
if(t1 > 0)
assert(t2 > 0);
else
assert(t2 < 0);
assert(!(t2 > 0));
}

View File

@ -107,11 +107,12 @@ at compile-time) available.</p>
<h2><a name="credits">Credits</a></h2>
<p>The author of the Boost binary logarithm class template is <a
href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
href="../../../people/daryle_walker.html">Daryle Walker</a>. Giovanni Bajo
added support for compilers without partial template specialization.</p>
<hr>
<p>Revised October 1, 2001</p>
<p>Revised May 14, 2002</p>
<p>&copy; Copyright Daryle Walker 2001. Permission to copy, use,
modify, sell and distribute this document is granted provided this

View File

@ -106,7 +106,7 @@ class template.</p>
<h2><a name="credits">Credits</a></h2>
<p>The author of the Boost compile-time extrema class templates is <a
href="../../../../people/daryle_walker.html">Daryle Walker</a>.</p>
href="../../../people/daryle_walker.html">Daryle Walker</a>.</p>
<hr>

View File

@ -228,9 +228,9 @@ namespace boost
# else
# error defaults not correct; you must hand modify boost/cstdint.hpp
# endif
# elif (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520))
# elif defined(BOOST_HAS_MS_INT64)
//
// we have Borland/Microsoft __int64:
// we have Borland/Intel/Microsoft __int64:
//
typedef __int64 intmax_t;
typedef unsigned __int64 uintmax_t;
@ -272,9 +272,9 @@ BOOST_HAS_STDINT_H is defined (John Maddock).
#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H)
# define BOOST__STDC_CONSTANT_MACROS_DEFINED
# if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520))
# if defined(BOOST_HAS_MS_INT64)
//
// Borland/Microsoft compilers have width specific suffixes:
// Borland/Intel/Microsoft compilers have width specific suffixes:
//
# define INT8_C(value) value##i8
# define INT16_C(value) value##i16

View File

@ -12,9 +12,13 @@
#include <boost/integer_fwd.hpp> // self include
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT
#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT, etc.
#include <boost/limits.hpp> // for std::numeric_limits
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#include <boost/pending/ct_if.hpp> // for boost::ct_if<>
#endif
namespace boost
{
@ -30,9 +34,22 @@ template < unsigned long Val, int Place = 0, int Index
= std::numeric_limits<unsigned long>::digits >
struct static_log2_helper_t;
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template < unsigned long Val, int Place >
struct static_log2_helper_t< Val, Place, 1 >;
#else
template < int Place >
struct static_log2_helper_final_step;
template < unsigned long Val, int Place = 0, int Index
= std::numeric_limits<unsigned long>::digits >
struct static_log2_helper_nopts_t;
#endif
// Recursively build the logarithm by examining the upper bits
template < unsigned long Val, int Place, int Index >
struct static_log2_helper_t
@ -50,7 +67,11 @@ private:
: Place );
BOOST_STATIC_CONSTANT( int, new_index = Index - half_place );
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef static_log2_helper_t<new_val, new_place, new_index> next_step_type;
#else
typedef static_log2_helper_nopts_t<new_val, new_place, new_index> next_step_type;
#endif
public:
BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
@ -58,6 +79,8 @@ public:
}; // boost::detail::static_log2_helper_t
// Non-recursive case
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template < unsigned long Val, int Place >
struct static_log2_helper_t< Val, Place, 1 >
{
@ -66,6 +89,33 @@ public:
}; // boost::detail::static_log2_helper_t
#else
template < int Place >
struct static_log2_helper_final_step
{
public:
BOOST_STATIC_CONSTANT( int, value = Place );
}; // boost::detail::static_log2_helper_final_step
template < unsigned long Val, int Place, int Index >
struct static_log2_helper_nopts_t
{
private:
typedef static_log2_helper_t<Val, Place, Index> recursive_step_type;
typedef static_log2_helper_final_step<Place> final_step_type;
typedef typename ct_if<( Index != 1 ), recursive_step_type,
final_step_type>::type next_step_type;
public:
BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
}; // boost::detail::static_log2_helper_nopts_t
#endif
} // namespace detail

View File

@ -35,10 +35,20 @@
* Therefore, avoid explicit function template instantiations.
*/
#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
template<typename T> inline T make_char_numeric_for_streaming(T x) { return x; }
namespace fix{
inline int make_char_numeric_for_streaming(char c) { return c; }
inline int make_char_numeric_for_streaming(signed char c) { return c; }
inline int make_char_numeric_for_streaming(unsigned char c) { return c; }
}
using namespace fix;
#else
template<typename T> inline T make_char_numeric_for_streaming(T x) { return x; }
inline int make_char_numeric_for_streaming(char c) { return c; }
inline int make_char_numeric_for_streaming(signed char c) { return c; }
inline int make_char_numeric_for_streaming(unsigned char c) { return c; }
#endif
template<class T>
void runtest(const char * type, T)
@ -73,7 +83,7 @@ int test_main(int, char*[])
runtest("long", long());
typedef unsigned long unsigned_long;
runtest("unsigned long", unsigned_long());
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_MSVC) && !defined(__BORLANDC__) && !defined(__BEOS__)
#if !defined(BOOST_NO_INT64_T) && (!defined(BOOST_MSVC) || BOOST_MSVC > 1300) && !defined(__BORLANDC__) && !defined(__BEOS__)
//
// MS/Borland compilers can't support 64-bit member constants
// BeOS doesn't have specialisations for long long in SGI's <limits> header.