Solaris/gcc integer_traits #error on build

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

Because the Sun C library doesn't support some of the wide-character formatting routines, older versions of gcc were not including full wide character support in libstdc++ (which caused BOOST_NO_INTRINSIC_WCHAR_T to be defined). This bug is fixed in gcc 3.4.x. See (among others): http://gcc.gnu.org/ml/gcc-help/2003-12/msg00014.html -- Caleb Epstein caleb dot epstein at gmail dot com
participants (2)
-
Caleb Epstein
-
Christopher Wiedel