Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79789 - trunk/boost/xpressive/traits/detail
From: eric_at_[hidden]
Date: 2012-07-28 19:36:52


Author: eric_niebler
Date: 2012-07-28 19:36:51 EDT (Sat, 28 Jul 2012)
New Revision: 79789
URL: http://svn.boost.org/trac/boost/changeset/79789

Log:
work around missing __isctype on some glibc implementations
Text files modified:
   trunk/boost/xpressive/traits/detail/c_ctype.hpp | 12 ++++++++++--
   1 files changed, 10 insertions(+), 2 deletions(-)

Modified: trunk/boost/xpressive/traits/detail/c_ctype.hpp
==============================================================================
--- trunk/boost/xpressive/traits/detail/c_ctype.hpp (original)
+++ trunk/boost/xpressive/traits/detail/c_ctype.hpp 2012-07-28 19:36:51 EDT (Sat, 28 Jul 2012)
@@ -496,8 +496,7 @@
 
     static bool isctype(char ch, char_class_type mask)
     {
- using namespace std;
- if(0 != __isctype(static_cast<unsigned char>(ch), mask))
+ if(glibc_isctype(ch, mask))
         {
             return true;
         }
@@ -511,6 +510,15 @@
 
         return false;
     }
+
+ static bool glibc_isctype(char ch, char_class_type mask)
+ {
+ #ifdef __isctype
+ return 0 != __isctype(ch, mask);
+ #else
+ return 0 != ((*__ctype_b_loc())[(int)(ch)] & (unsigned short int)mask);
+ #endif
+ }
 };
 
 #ifndef BOOST_XPRESSIVE_NO_WREGEX


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