Switch to C++11

Change-Id: Ib2970327c36422d7b11103d52ba7e9e52db5554f
diff --git a/native/jni/Android.mk b/native/jni/Android.mk
index 3b3da96..9657b9d 100644
--- a/native/jni/Android.mk
+++ b/native/jni/Android.mk
@@ -31,15 +31,12 @@
     -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \
     -Woverloaded-virtual -Wstrict-null-sentinel -Wsign-promo -Wno-system-headers
 
-ifeq ($(TARGET_ARCH), arm)
-ifeq ($(TARGET_GCC_VERSION), 4.6)
-LOCAL_CFLAGS += -Winline
-endif # TARGET_GCC_VERSION
-endif # TARGET_ARCH
-
 # To suppress compiler warnings for unused variables/functions used for debug features etc.
 LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
 
+# For C++11
+LOCAL_CFLAGS += -std=c++11
+
 include $(LOCAL_PATH)/NativeFileList.mk
 
 LOCAL_SRC_FILES := \
@@ -64,7 +61,7 @@
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_SDK_VERSION := 14
-LOCAL_NDK_STL_VARIANT := stlport_static
+LOCAL_NDK_STL_VARIANT := gnustl_static
 
 include $(BUILD_STATIC_LIBRARY)
 ######################################
@@ -87,7 +84,7 @@
 LOCAL_MODULE_TAGS := optional
 
 LOCAL_SDK_VERSION := 14
-LOCAL_NDK_STL_VARIANT := stlport_static
+LOCAL_NDK_STL_VARIANT := gnustl_static
 LOCAL_LDFLAGS += -ldl
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp b/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp
index bc4ca8e..f846154 100644
--- a/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp
+++ b/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp
@@ -16,6 +16,7 @@
 
 #include "suggest/core/layout/proximity_info_state_utils.h"
 
+#include <algorithm>
 #include <cmath>
 #include <cstring> // for memset()
 #include <sstream> // for debug prints
diff --git a/native/jni/src/utils/hash_map_compat.h b/native/jni/src/utils/hash_map_compat.h
index a1e982b..7bf35a6 100644
--- a/native/jni/src/utils/hash_map_compat.h
+++ b/native/jni/src/utils/hash_map_compat.h
@@ -17,18 +17,12 @@
 #ifndef LATINIME_HASH_MAP_COMPAT_H
 #define LATINIME_HASH_MAP_COMPAT_H
 
-// TODO: Use std::unordered_map that has been standardized in C++11
+#include <unordered_map>
 
-#ifdef __APPLE__
-#include <ext/hash_map>
-#else // __APPLE__
-#include <hash_map>
-#endif // __APPLE__
+#define hash_map_compat std::unordered_map
 
-#ifdef __SGI_STL_PORT
-#define hash_map_compat stlport::hash_map
-#else // __SGI_STL_PORT
-#define hash_map_compat __gnu_cxx::hash_map
-#endif // __SGI_STL_PORT
+#if 0 // TODO: Use this instead of the above macro.
+template <typename TKey, typename TValue> using hash_map_compat = std::unordered_map<TKey, TValue>;
+#endif
 
 #endif // LATINIME_HASH_MAP_COMPAT_H
diff --git a/tools/dicttool/NativeLib.mk b/tools/dicttool/NativeLib.mk
index 05e5841..26b6774 100644
--- a/tools/dicttool/NativeLib.mk
+++ b/tools/dicttool/NativeLib.mk
@@ -33,6 +33,10 @@
 LOCAL_CFLAGS += -DHOST_TOOL -fPIC -Wno-deprecated
 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
 
+# For C++11
+# TODO: Change this to -std=c++11
+LOCAL_CFLAGS += -std=gnu++0x
+
 LATINIME_NATIVE_JNI_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni
 LATINIME_NATIVE_SRC_DIR := $(LATINIME_DIR_RELATIVE_TO_DICTTOOL)/native/jni/src
 LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(LATINIME_NATIVE_SRC_DIR)