Author: Mikoláš Janota Description: compliance to the C++11 standard Debian-bug: #811793 --- a/basic_clset.hh +++ b/basic_clset.hh @@ -34,11 +34,7 @@ #include #include -#include // Location of STL hash extensions -#include // Location of STL hash extensions - using namespace std; -using namespace __gnu_cxx; // Required for STL hash extensions #include "globals.hh" #include "basic_clause.hh" --- a/cl_globals.hh +++ b/cl_globals.hh @@ -34,11 +34,7 @@ #include #include -#include // Location of STL hash extensions -#include // Location of STL hash extensions - using namespace std; -using namespace __gnu_cxx; // Required for STL hash extensions #include "globals.hh" #include "basic_clause.hh" --- a/cl_registry.hh +++ b/cl_registry.hh @@ -34,8 +34,6 @@ #include #include -#include // Location of STL hash extensions -#include // Location of STL hash extensions #include // Location of STL hash extensions using namespace std; --- a/cl_types.hh +++ b/cl_types.hh @@ -66,7 +66,7 @@ typedef vector BasicClauseVector; typedef BasicClauseVector::iterator ClVectIterator; -typedef slist BasicClauseSList; +//typedef slist BasicClauseSList; typedef list BasicClauseList; --- a/collections.hh +++ b/collections.hh @@ -34,7 +34,7 @@ typedef vector PackageVersionsList; typedef vector PackageVersionsCNF; typedef vector PackageVersionList; -typedef unordered_map< const char*,string,__gnu_cxx::hash, streq > Str2Str; +typedef unordered_map< const char*,string,std::hash, streq > Str2Str; typedef unordered_map PackageVersionMap; typedef unordered_map VariableToPackageVersion; typedef vector VersionVector; --- a/common_types.hh +++ b/common_types.hh @@ -25,13 +25,9 @@ #ifndef COMMON_TYPES_H #define COMMON_TYPES_H -#include -#include +#include "hash_structs.hh" #include #include "types.hh" -using __gnu_cxx::hash; -using __gnu_cxx::hash_map; -using __gnu_cxx::hash_set; using std::string; using std::vector; using std::ostream; @@ -40,8 +36,6 @@ #define CONSTANT const #define CONTAINS(s,e) ( ((s).find(e))!=(s).end() ) #define SAME_PACKAGE_NAME(n1,n2) (n1.data()==n2.data()) -#define unordered_set hash_set -#define unordered_map hash_map typedef unsigned int UINT; typedef UINT Version; @@ -115,6 +109,7 @@ {return strcmp(s1, s2) == 0;} }; +/* namespace __gnu_cxx { template<> @@ -126,7 +121,9 @@ return h(s.data()); } }; -} /*end of namespace __gnu_cxx */ +}*/ /*end of namespace __gnu_cxx */ + + const char* to_string (KeepValue value); const char* to_string (Criterion value); --- a/cudf_msu.cc +++ b/cudf_msu.cc @@ -27,8 +27,9 @@ #include "Options.hh" using std::ifstream; -static const char* dist_date = ""DISTDATE""; -static const char* changeset = ""CHANGESET""; +#define stringify(s) #s +static const char* dist_date = stringify(DISTDATE); +static const char* changeset = stringify(CHANGESET); static const char* release = "0.6"; IDManager id_manager; --- a/hash_structs.hh +++ b/hash_structs.hh @@ -0,0 +1,12 @@ +#ifndef HASH_STRUCTS_123 +#define HASH_STRUCTS_123 + +#include +#include +#define hash_multimap unordered_multimap +#define hash_set unordered_set +#define hash_map unordered_map +using std::hash; +using std::unordered_map; +using std::unordered_set; +#endif --- a/types.hh +++ b/types.hh @@ -38,6 +38,12 @@ using namespace std; +#include +#include +#define hash_multimap unordered_multimap +#define hash_set unordered_set +#define hash_map unordered_map + /*----------------------------------------------------------------------------*\ * Values besides 0 and 1 @@ -158,11 +164,8 @@ #include #include #include // Location of STL list extensions -#include // Location of STL hash extensions -#include // Location of STL hash extensions using namespace std; -using namespace __gnu_cxx; // Required for STL hash extensions #ifdef USE_RBTREE_SETS