blob: 67dfadd5405af094882609d50b20b4cda773e107 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
Description: Fix FTBFS on GCC 6 by removing use of hash_set class
Author: James Cowgill <jcowgill@debian.org>
Bug-Debian: https://bugs.debian.org/811885
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/WordList.h
+++ b/WordList.h
@@ -18,24 +18,11 @@
#ifndef __WORDLIST_H__
#define __WORDLIST_H__
+#include <string>
#include <vector>
-#include <ext/hash_set>
+#include <unordered_set>
-using namespace std;
-using namespace __gnu_cxx;
-
-namespace __gnu_cxx
-{
- template<> struct hash< std::string >
- {
- size_t operator()( const std::string& x ) const
- {
- return hash< const char* >()( x.c_str() );
- }
- };
-}
-
-typedef hash_set<string, hash<string> > string_hash_set;
+typedef std::unordered_set<std::string> string_hash_set;
class WordList {
private:
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,9 @@ else
OSXCOMPAT =
endif
+# enable c++11
+CXXFLAGS += -std=c++11
+
# object files have corresponding source files
CXX = g++
|