aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-02-08 16:15:21 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-02-08 16:15:21 -0800
commitc844ed84ffa7ef658949abc08d25462958744eb6 (patch)
tree0d427087481fc5266ebce4f2d7238dd8132aaabb
parent6c21c614aac4500a74b78b91cbbe12dcd22f6af0 (diff)
parent595717c22f51d0bb2035bceacffd02a280ef6218 (diff)
Merge pull request #226 from FishingCactus/istream2
Missing files for c++ locale
-rw-r--r--system/include/libcxx/__locale15
-rw-r--r--system/lib/libcxx/locale.cpp2
2 files changed, 15 insertions, 2 deletions
diff --git a/system/include/libcxx/__locale b/system/include/libcxx/__locale
index f63815c3..7b7cfcd7 100644
--- a/system/include/libcxx/__locale
+++ b/system/include/libcxx/__locale
@@ -330,8 +330,21 @@ public:
static const mask punct = _PUNCT;
static const mask xdigit = _HEX;
static const mask blank = _BLANK;
+#elif defined( EMSCRIPTEN )
+ #define _ISbit(bit) ((bit) < 8 ? ((1 << (bit)) << 8) : ((1 << (bit)) >> 8))
+ typedef __uint16_t mask;
+ static const mask upper = _ISbit( 0 );
+ static const mask lower = _ISbit( 1 );
+ static const mask alpha = _ISbit( 2 );
+ static const mask digit = _ISbit( 3 );
+ static const mask xdigit = _ISbit( 4 );
+ static const mask space = _ISbit( 5 );
+ static const mask print = _ISbit( 6 );
+ static const mask blank = _ISbit( 8 );
+ static const mask cntrl = _ISbit( 9 );
+ static const mask punct = _ISbit( 10 );
#else // __GLIBC__ || _WIN32
-#if defined(__APPLE__) || defined(EMSCRIPTEN)
+#if defined(__APPLE__)
typedef __uint32_t mask;
#elif __FreeBSD__
typedef unsigned long mask;
diff --git a/system/lib/libcxx/locale.cpp b/system/lib/libcxx/locale.cpp
index 0530b7af..4675fec3 100644
--- a/system/lib/libcxx/locale.cpp
+++ b/system/lib/libcxx/locale.cpp
@@ -910,7 +910,7 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
}
// XXX Emscripten define local table
-extern "C" const unsigned int ** __ctype_b_loc();
+extern "C" const unsigned short ** __ctype_b_loc();
extern "C" const int ** __ctype_tolower_loc();
extern "C" const int ** __ctype_toupper_loc();