Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56265 - trunk/boost/spirit/home/support/char_encoding
From: hartmut.kaiser_at_[hidden]
Date: 2009-09-17 07:32:40


Author: hkaiser
Date: 2009-09-17 07:32:40 EDT (Thu, 17 Sep 2009)
New Revision: 56265
URL: http://svn.boost.org/trac/boost/changeset/56265

Log:
Spirit: fixed gcc compilation errors
Text files modified:
   trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp | 31 ++++++++++++++++++-------------
   1 files changed, 18 insertions(+), 13 deletions(-)

Modified: trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp
==============================================================================
--- trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp (original)
+++ trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp 2009-09-17 07:32:40 EDT (Thu, 17 Sep 2009)
@@ -18,11 +18,27 @@
 #include <boost/cstdint.hpp>
 #include <boost/spirit/home/support/assert_msg.hpp>
 
+namespace boost { namespace spirit { namespace traits
+{
+ template <std::size_t N>
+ struct wchar_t_size
+ {
+ BOOST_SPIRIT_ASSERT_MSG(N == 1 || N == 2 || N == 4,
+ not_supported_size_of_wchar_t, ());
+ };
+
+ template <> struct wchar_t_size<1> { enum { mask = 0xff }; };
+ template <> struct wchar_t_size<2> { enum { mask = 0xffff }; };
+ template <> struct wchar_t_size<4> { enum { mask = 0xffffffff }; };
+
+}}}
+
 namespace boost { namespace spirit { namespace char_encoding
 {
     ///////////////////////////////////////////////////////////////////////////
     // Test characters for specified conditions (using std wchar_t functions)
     ///////////////////////////////////////////////////////////////////////////
+
     struct standard_wide
     {
         typedef wchar_t char_type;
@@ -41,23 +57,12 @@
             return std::char_traits<Char>::to_char_type(ch);
         }
 
- template <std::size_t N>
- struct wchar_t_size
- {
- BOOST_SPIRIT_ASSERT_MSG(N == 1 || N == 2 || N == 4,
- not_supported_size_of_wchar_t, ());
- };
-
- template <> struct wchar_t_size<1> { enum { mask = 0xff }; };
- template <> struct wchar_t_size<2> { enum { mask = 0xffff }; };
- template <> struct wchar_t_size<4> { enum { mask = 0xffffffff }; };
-
         static bool
         ischar(int ch)
         {
             // we have to watch out for sign extensions
- return ( 0 == (ch & ~wchar_t_size<sizeof(wchar_t)>::mask) ||
- ~0 == (ch | wchar_t_size<sizeof(wchar_t)>::mask)) ?
+ return ( 0 == (ch & ~traits::wchar_t_size<sizeof(wchar_t)>::mask) ||
+ ~0 == (ch | traits::wchar_t_size<sizeof(wchar_t)>::mask)) ?
                 true : false; // any wchar_t, but no other bits set
         }
 


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