Boost logo

Boost-Commit :

From: hartmut.kaiser_at_[hidden]
Date: 2008-04-20 09:37:42


Author: hkaiser
Date: 2008-04-20 09:37:42 EDT (Sun, 20 Apr 2008)
New Revision: 44628
URL: http://svn.boost.org/trac/boost/changeset/44628

Log:
Spirit.Lex: Yet another wchar_t fix.
Text files modified:
   trunk/boost/spirit/home/support/detail/lexer/consts.hpp | 12 ++++--------
   1 files changed, 4 insertions(+), 8 deletions(-)

Modified: trunk/boost/spirit/home/support/detail/lexer/consts.hpp
==============================================================================
--- trunk/boost/spirit/home/support/detail/lexer/consts.hpp (original)
+++ trunk/boost/spirit/home/support/detail/lexer/consts.hpp 2008-04-20 09:37:42 EDT (Sun, 20 Apr 2008)
@@ -7,9 +7,7 @@
 #define BOOST_LEXER_CONSTS_H
 
 #include <boost/config.hpp>
-#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && (!defined(BOOST_NO_CWCHAR) || defined(sun) || defined(__sun))
-#include <wchar.h>
-#endif
+#include <boost/integer_traits.hpp>
 #include <boost/spirit/home/support/detail/lexer/size_t.hpp>
 
 namespace boost
@@ -23,11 +21,9 @@
 
     const std::size_t max_macro_len = 20;
     const std::size_t num_chars = 256;
-#if defined(WCHAR_MAX)
- const std::size_t num_wchar_ts = WCHAR_MAX < 0x110000 ? WCHAR_MAX : 0x110000;
-#else
- const std::size_t num_wchar_ts = 0x110000;
-#endif
+ const std::size_t num_wchar_ts =
+ (boost::integer_traits<wchar_t>::const_max < 0x110000) ?
+ boost::integer_traits<wchar_t>::const_max : 0x110000;
     const std::size_t null_token = static_cast<std::size_t> (~0);
     const std::size_t bol_token = static_cast<std::size_t> (~1);
     const std::size_t eol_token = static_cast<std::size_t> (~2);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk