Boost logo

Boost :

From: Christopher Wiedel (cjwiedel_at_[hidden])
Date: 2005-02-07 12:02:06


I ran into a problem with the integer_traits.hpp file in the boost
subdirectory at build time, specifically while trying to build the
libboost_python-* files. It seems to be the same problem that was
earlier encountered here:
http://lists.boost.org/MailArchives/boost/msg76535.php

I downloaded the patched version of integer_traits.hpp from CVS, but the
problem persisted. I checked the #if statement beginning on line 87 of
the newer version of the file, and there didn't appear to be any case
for Solaris. I was building on a Solaris 8 machine, using gcc 3.3.2. I
modified the file to add another case (line 101):

     87 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
    88 template<>
    89 class integer_traits<wchar_t>
    90 : public std::numeric_limits<wchar_t>,
    91 #if defined(WCHAR_MIN) && defined(WCHAR_MAX)
    92 public detail::integer_traits_base<wchar_t, WCHAR_MIN,
WCHAR_MAX>
    93 #elif defined(__BORLANDC__) || defined(__CYGWIN__) ||
       defined(__MINGW32_ _) || (defined(__BEOS__) &&
       defined(__GNUC__))
    94 // No WCHAR_MIN and WCHAR_MAX, whar_t is short and unsigned:
    95 public detail::integer_traits_base<wchar_t, 0, 0xffff>
    96 #elif (defined(__sgi) && (!defined(__SGI_STL_PORT) ||
       __SGI_STL_PORT < 0 x400))\
    97 || (defined __APPLE__)\
    98 || (defined(__OpenBSD__) && defined(__GNUC__))\
    99 || (defined(__NetBSD__) && defined(__GNUC__))\
   100 || (defined(__FreeBSD__) && defined(__GNUC__))\
   101 || (defined(__sun__) && defined (__GNUC__) && (__GNUC__ == 3)\
   102 || (defined(__hpux) && defined(__GNUC__) && (__GNUC__ ==
       3) && !defined(__SGI_STL_PORT))
   103 // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as
int.
   104 // - SGI MIPSpro with native library
   105 // - gcc 3.x on HP-UX
   106 // - Mac OS X with native library
   107 // - gcc on FreeBSD, OpenBSD and NetBSD
   108 public detail::integer_traits_base<wchar_t, INT_MIN, INT_MAX>
   109 #elif defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 2)
       && !defined(__SGI_STL_PORT)
   110 // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range
       as unsigned int.
   111 // - gcc 2.95.x on HP-UX
   112 // (also, std::numeric_limits<wchar_t> appears to return
       the wrong values).
   113 public detail::integer_traits_base<wchar_t, 0, UINT_MAX>
   114 #else
   115 #error No WCHAR_MIN and WCHAR_MAX present, please adjust
       integer_traits< > for your compiler.
   116 #endif
   117 { };
   118 #endif // BOOST_NO_INTRINSIC_WCHAR_T

The file then compiled without a problem when inluded in the python
libraries. The question I still have is whether this has the potential
to break something somewhere else in the code.

-- 
Christopher Wiedel
Software Installs Group
University of Southern California

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk