Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
message("Compiler : GNU Compiler (gcc)")
set(GCC "TRUE")
# set(COMBINED_FLAGS "-Wall -Wno-unused-function -Wno-sign-compare -pedantic -D_GNU_SOURCE -fms-extensions -Wno-deprecated")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g0")
set(CMAKE_C_FLAGS_RELEASE "-O3 -g0")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
20 changes: 18 additions & 2 deletions tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@
#endif

#if defined(USE_HASH_MAP) && !defined(_MSC_VER)
#if !defined(__GNUC__)
#if defined(__clang__)
// libc++ detected: _LIBCPP_VERSION
// libstdc++ detected: __GLIBCXX__
#include <unordered_map>
#include <unordered_set>
#elif !defined(__GNUC__)
#include <hash_map>
#include <hash_set>
using namespace stdext;
Expand All @@ -69,10 +74,21 @@
using namespace __gnu_cxx;
#define unordered_map hash_map
#define unordered_set hash_set
#else
/*
NHANLT: resolve ambiguous reference
std::tr1 is Technical Report 1, a proposal of extensions for C++0X when waiting
for C++11 to get approved. Most of features (including
std::tr1::unordered_map/set) in Technical Report 1 had been merged into C++11.
C++11 had been fully implemented since GCC 4.8.1 -> we only need to use std::tr1
in GCC older than 4.8.1
*/
#elif GCC_VERSION < 40800
#include <tr1/unordered_map>
#include <tr1/unordered_set>
using namespace std::tr1;
#else
#include <unordered_map>
#include <unordered_set>
#endif
#else
#include <map>
Expand Down