diff -urN kawari-828.original\build\src\em-post.js kawari-828\build\src\em-post.js
--- kawari-828.original\build\src\em-post.js	Thu Jan 01 09:00:00 1970
+++ kawari-828\build\src\em-post.js	Fri Nov 07 12:20:05 2014
@@ -0,0 +1,3 @@
+	this['Module']=Module;
+	this['FS']=FS;
+};
diff -urN kawari-828.original\build\src\em-pre.js kawari-828\build\src\em-pre.js
--- kawari-828.original\build\src\em-pre.js	Thu Jan 01 09:00:00 1970
+++ kawari-828\build\src\em-pre.js	Fri Nov 07 13:10:17 2014
@@ -0,0 +1,2 @@
+'(C) 2014 Narazaka : Licensed under The BSD 3-Clause License - http://narazaka.net/license/BSD3?2014';
+Kawari=function(){
\ No newline at end of file
diff -urN kawari-828.original\build\src\emscripten.mak kawari-828\build\src\emscripten.mak
--- kawari-828.original\build\src\emscripten.mak	Thu Jan 01 09:00:00 1970
+++ kawari-828\build\src\emscripten.mak	Sat Nov 22 21:37:50 2014
@@ -0,0 +1,190 @@
+#==========================================================================
+# manualconf
+#==========================================================================
+include files.mak
+
+CXX = em++
+
+#==========================================================================
+# Targets and Features
+#==========================================================================
+
+## choose your target: cygwin, mingw, linux, freebsd, darwin
+MACH_TYPE = em
+
+## output name
+SHIORI = kawari
+
+## if you have 'upx' and want to use it
+# UPX = upx
+#UPX = upx
+
+## if you want to use STLport, set STLport=yes
+# STLport = yes
+
+## if you want to use native SAORI, set SAORI_NATIVE=yes (default)
+SAORI_NATIVE = yes
+
+## if you want to use Python SAORI, set SAORI_PYTHON=yes
+# SAORI_PYTHON = yes
+
+## if you want to use Java SAORI, set SAORI_JAVA=yes
+# SAORI_JAVA = yes
+
+## if you want to make a Python SHIORI, set SHIORI_PYTHON=yes
+# SHIORI_PYTHON = yes
+
+## Global options
+CFLAGS  = -O3 -I. -DNDEBUG -Wall -fomit-frame-pointer -UWIN32 -U_WIN32 -U_Windows -U__CYGWIN__ -s ALLOW_MEMORY_GROWTH=1
+EXPORTED_FUNCTIONS = "['_load','_unload','_request','_so_library_init','_so_library_cleanup','_so_getmoduleversion','_so_create','_so_dispose','_so_request','_so_free']"
+LDFLAGS = -O3 --memory-init-file 0 --pre-js em-pre.js --post-js em-post.js -s EXPORTED_FUNCTIONS=$(EXPORTED_FUNCTIONS) -s ALLOW_MEMORY_GROWTH=1
+
+#==========================================================================
+# Directories
+#==========================================================================
+
+## STLport specific options
+CFLAGS_STLP  = -I/MinGW/include/stlport
+LDFLAGS_STLP = 
+LIBS_STLP = -lstlport_r50_static
+
+## Python specific options. These are only for Win32.
+# CFLAGS_PYTHON  = -I/python23/include
+# LDFLAGS_PYTHON = -L/python23/lib
+# LIBS_PYTHON = -lpython23
+
+## Java specific options
+JAVA_HOME  = /usr/java/j2sdk
+CFLAGS_JAVA  = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
+LDFLAGS_JAVA = 
+
+#==========================================================================
+# Do not modify below
+#==========================================================================
+include gcc-mach.mak
+
+MACH = ../mach/$(MACH_TYPE)
+EXEEXT = $(EXEEXT_$(MACH_TYPE))
+DYNLIBPREFIX = $(DYNLIBPREFIX_$(MACH_TYPE))
+DYNLIBEXT = $(DYNLIBEXT_$(MACH_TYPE))
+OBJEXT = .o
+DYNIMPLIB = ../mach/$(MACH_TYPE)/$(SHIORI)$(LIBEXT_$(MACH_TYPE))
+
+ifeq ($(STLport),yes)
+	CFLAGS  := $(CFLAGS_STLP) -DHAVE_SSTREAM $(CFLAGS)
+	LDFLAGS := $(LDFLAGS) $(LDFLAGS_STLP)
+	LIBS    := $(LIBS) $(LIBS_STLP)
+endif
+
+ifeq ($(SAORI_NATIVE),yes)
+	CFLAGS  := -DENABLE_SAORI_NATIVE $(CFLAGS)
+	CORESRC  := $(CORESRC) $(CORESRC_NATIVE)
+endif
+
+ifeq ($(SAORI_JAVA),yes)
+	CORESRC := $(CORESRC) $(CORESRC_JAVA)
+	CFLAGS  := $(CFLAGS) $(CFLAGS_JAVA) -DENABLE_SAORI_JAVA
+	ifeq ($(MACH_TYPE),mingw)
+		LDFLAGS := $(LDFLAGS) -L$(MACH)
+		LIBS    := $(LIBS) -ljvm
+		DEPLIB  := $(MACH)/libjvm.dll.a
+	endif
+endif
+
+ifeq ($(SAORI_PYTHON),yes)
+	_LINK_PYTHON_ = 1
+	CORESRC := $(CORESRC) $(CORESRC_PYTHON)
+	CFLAGS := -DENABLE_SAORI_PYTHON $(CFLAGS)
+endif
+
+ifeq ($(SHIORI_PYTHON),yes)
+	_LINK_PYTHON = 1
+	SHIOSRC := $(SHIOSRC) $(SHIOSRC_PYTHON)
+endif
+
+ifdef _LINK_PYTHON_
+	PYTHON_VER = $(shell python -c "import sys; print sys.version[:3]")
+	ifndef CFLAGS_PYTHON
+		CFLAGS_PYTHON = -I$(shell python -c "import sys; print sys.prefix+'/include/python'+sys.version[:3]")
+		CFLAGS  := $(CFLAGS_PYTHON) $(CFLAGS)
+		LIBS    := $(LIBS) -lpython$(PYTHON_VER)
+	endif
+endif
+
+# SHIOSRC
+
+# KOSUISRC
+KOSUISRC := $(KOSUISRC) $(KOSUISRC_$(MACH_TYPE))
+
+# flags
+CFLAGS  := $(CFLAGS_$(MACH_TYPE)) $(CFLAGS)
+LDFLAGS := $(LDFLAGS_$(MACH_TYPE)) $(LDFLAGS)
+LIBS    := $(LIBS) $(LIBS_$(MACH_TYPE))
+DYNLIBDEF := shiori_$(MACH_TYPE).def
+
+# commands
+ifndef CXX
+	CXX := $(CXX_$(MACH_TYPE))
+endif
+ifndef LD
+	LD := $(CXX_$(MACH_TYPE))
+endif
+STRIP = strip
+ifndef RUBY
+	RUBY := ruby
+endif
+
+# object files
+COREOBJ =  $(CORESRC:.cpp=$(OBJEXT))
+SHIOOBJ =  $(SHIOSRC:.cpp=$(OBJEXT))
+CRYPTOBJ = $(CRYPTSRC:.cpp=$(OBJEXT))
+KOSUIOBJ = $(KOSUISRC:.cpp=$(OBJEXT))
+TOOLOBJ =  $(TOOLSRC:.cpp=$(OBJEXT))
+
+ALLTARGET = $(MACH)/$(DYNLIBPREFIX)$(SHIORI)$(DYNLIBEXT) \
+            $(MACH)/kosui$(EXEEXT) \
+            $(MACH)/kawari_encode$(EXEEXT) \
+            $(MACH)/kawari_encode2$(EXEEXT) \
+            $(MACH)/kawari_decode2$(EXEEXT)
+
+## TARGETS ##
+.PHONY: clean cleanall depend upx
+
+all : $(ALLTARGET) upx
+
+$(MACH)/$(DYNLIBPREFIX)$(SHIORI)$(DYNLIBEXT) : $(SHIOOBJ) $(COREOBJ) $(DEPLIB)
+	$(CXX) -o $@ $(SHARED_$(MACH_TYPE)) $(LDFLAGS) $(SHIOOBJ) $(COREOBJ) $(LIBS)
+
+$(MACH)/kosui$(EXEEXT) : $(KOSUIOBJ) $(COREOBJ) $(DEPLIB)
+	$(CXX) -o $@ $(LDFLAGS) $(KOSUIOBJ) $(COREOBJ) $(LIBS)
+
+$(MACH)/kawari_encode$(EXEEXT) : tool/kawari_encode$(OBJEXT) $(CRYPTOBJ)
+	$(CXX) -o $@ tool/kawari_encode$(OBJEXT) $(CRYPTOBJ) $(LDFLAGS)
+
+$(MACH)/kawari_encode2$(EXEEXT) : tool/kawari_encode2$(OBJEXT) $(CRYPTOBJ)
+	$(CXX) -o $@ tool/kawari_encode2$(OBJEXT) $(CRYPTOBJ) $(LDFLAGS)
+
+$(MACH)/kawari_decode2$(EXEEXT) : tool/kawari_decode2$(OBJEXT) $(CRYPTOBJ)
+	$(CXX) -o $@ tool/kawari_decode2$(OBJEXT) $(CRYPTOBJ) $(LDFLAGS)
+
+$(MACH)/libjvm.dll.a : win32jvm.def
+	dlltool --def win32jvm.def -l $@ --dllname jvm.dll -k -C -a
+
+.SUFFIXES : .cpp .h .a .def
+
+%.o : %.cpp
+	$(CXX) $(CFLAGS) -o $@ -c $<
+
+clean :
+	-rm $(COREOBJ) $(SHIOOBJ) $(KOSUIOBJ) $(TOOLOBJ) $(TEMPORARY_FILES)
+
+cleanall : clean
+	-rm $(ALLTARGET)
+
+depend : clean
+	$(RUBY) ./makedepend.rb > depend.mak
+
+upx : $(ALLTARGET)
+	$(UPX) $(ALLTARGET)
+
+include depend.mak
diff -urN kawari-828.original\build\src\gcc-mach.mak kawari-828\build\src\gcc-mach.mak
--- kawari-828.original\build\src\gcc-mach.mak	Wed Jun 15 06:40:00 2005
+++ kawari-828\build\src\gcc-mach.mak	Sat Nov 22 21:42:58 2014
@@ -1,53 +1,62 @@
 CXX_cygwin = g++
 CXX_mingw =  g++
+CXX_em =  em++
 CXX_linux =  g++
 CXX_freebsd =g++
 CXX_darwin = g++
 
 EXEEXT_cygwin = .exe
 EXEEXT_mingw =  .exe
+EXEEXT_em =  .js
 EXEEXT_linux =
 EXEEXT_freebsd =
 EXEEXT_darwin =
 
 DYNLIBPREFIX_cygwin = 
 DYNLIBPREFIX_mingw =
+DYNLIBPREFIX_em =
 DYNLIBPREFIX_linux =   lib
 DYNLIBPREFIX_freebsd = lib
 DYNLIBPREFIX_darwin =  lib
 
 DYNLIBEXT_cygwin =  .dll
 DYNLIBEXT_mingw =   .dll
+DYNLIBEXT_em =   .js
 DYNLIBEXT_linux =   .so
 DYNLIBEXT_freebsd = .so
 DYNLIBEXT_darwin =  .bundle
 
 LIBEXT_cygwin = .lib
 LIBEXT_mingw = .lib
+LIBEXT_em = .js
 LIBEXT_linux = .l
 LIBEXT_freebsd = .l
 LIBEXT_darwin = .l
 
 CFLAGS_cygwin =  -DUSEKDB
 CFLAGS_mingw =   -DUSEKDB
+CFLAGS_em =   -DUSEKDB
 CFLAGS_linux =
 CFLAGS_freebsd =
 CFLAGS_darwin =  
 
 LDFLAGS_cygwin = -Wl,--enable-auto-import -Wl,--enable-stdcall-fixup
 LDFLAGS_mingw = -Wl,--enable-auto-import -Wl,--enable-stdcall-fixup
+LDFLAGS_em = -Wl,--enable-auto-import -Wl,--enable-stdcall-fixup
 LDFLAGS_linux = 
 LDFLAGS_freebsd = 
 LDFLAGS_darwin = 
 
 SHARED_cygwin = -shared
 SHARED_mingw = -shared
+SHARED_em = -shared
 SHARED_linux = -shared
 SHARED_freebsd = -shared
 SHARED_darwin = -bundle
 
 LIBS_cygwin = 
 LIBS_mingw =
+LIBS_em =
 LIBS_linux = -ldl
 LIBS_freebsd =
 LIBS_darwin = -lstdc++
diff -urN kawari-828.original\build\src\libkawari\kawari_ns.h kawari-828\build\src\libkawari\kawari_ns.h
--- kawari-828.original\build\src\libkawari\kawari_ns.h	Tue Jun 28 13:33:14 2005
+++ kawari-828\build\src\libkawari\kawari_ns.h	Sat Nov 22 13:26:08 2014
@@ -17,6 +17,7 @@
 #include <vector>
 #include <map>
 #include <set>
+#include <climits>
 using namespace std;
 //---------------------------------------------------------------------------
 #include "libkawari/wordcollection.h"
diff -urN kawari-828.original\build\src\misc\mmap.h kawari-828\build\src\misc\mmap.h
--- kawari-828.original\build\src\misc\mmap.h	Wed Jun 22 07:51:44 2005
+++ kawari-828\build\src\misc\mmap.h	Wed Nov 05 16:08:46 2014
@@ -24,11 +24,11 @@
 	{
 //		iterator it=lower_bound(key);
 //		std::multimap<KeyType,DataType>::iterator it;
-		typename std::multimap<KeyType, DataType>::iterator it=lower_bound(key);
+		typename std::multimap<KeyType, DataType>::iterator it=this->lower_bound(key);
 		// 2001/12/16 suikyo@yk.rim.or.jp : imortal entry bug
 //		if(it==end()) it=insert(pair<KeyType,DataType>(key,DataType()));
 //		if(it==upper_bound(key)) it=insert(pair<const KeyType,DataType>(key,DataType()));
-		if(it==upper_bound(key)) it=insert(typename TMMap<KeyType,DataType>::value_type(key,DataType()));
+		if(it==this->upper_bound(key)) it=this->insert(typename TMMap<KeyType,DataType>::value_type(key,DataType()));
 		return((*it).second);
 	}
 /*
@@ -43,7 +43,7 @@
 	void Add(const KeyType& key,const DataType& data)
 	{
 //		insert(pair<const KeyType,DataType>(key,data));
-		insert(typename TMMap::value_type(key,data));
+		this->insert(typename TMMap::value_type(key,data));
 	}
 
 };
