Files
guru/sci-mathematics/packup/files/packup-0.6-c++11.patch
Alessandro Barbieri 59813a99ec sci-mathematics/packup: new package, add 0.6
Signed-off-by: Alessandro Barbieri <lssndrbarbieri@gmail.com>
2022-04-29 03:47:58 +02:00

167 lines
4.4 KiB
Diff

Author: Mikoláš Janota <mikolas.janota@gmail.com>
Description: compliance to the C++11 standard
Debian-bug: #811793
--- a/basic_clset.hh
+++ b/basic_clset.hh
@@ -34,11 +34,7 @@
#include <cmath>
#include <vector>
-#include <ext/hash_map> // Location of STL hash extensions
-#include <ext/hash_set> // 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 <cmath>
#include <vector>
-#include <ext/hash_map> // Location of STL hash extensions
-#include <ext/hash_set> // 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 <cmath>
#include <vector>
-#include <ext/hash_map> // Location of STL hash extensions
-#include <ext/hash_set> // Location of STL hash extensions
#include <ext/algorithm> // Location of STL hash extensions
using namespace std;
--- a/cl_types.hh
+++ b/cl_types.hh
@@ -66,7 +66,7 @@
typedef vector<BasicClause*> BasicClauseVector;
typedef BasicClauseVector::iterator ClVectIterator;
-typedef slist<BasicClause*> BasicClauseSList;
+//typedef slist<BasicClause*> BasicClauseSList;
typedef list<BasicClause*> BasicClauseList;
--- a/collections.hh
+++ b/collections.hh
@@ -34,7 +34,7 @@
typedef vector<PackageVersions> PackageVersionsList;
typedef vector<PackageVersionsList*> PackageVersionsCNF;
typedef vector<PackageVersion> PackageVersionList;
-typedef unordered_map< const char*,string,__gnu_cxx::hash<const char*>, streq > Str2Str;
+typedef unordered_map< const char*,string,std::hash<const char*>, streq > Str2Str;
typedef unordered_map<PackageVersion, Variable, hash_package_version, eq_package_version> PackageVersionMap;
typedef unordered_map<Variable,PackageVersion> VariableToPackageVersion;
typedef vector<Version> VersionVector;
--- a/common_types.hh
+++ b/common_types.hh
@@ -25,13 +25,9 @@
#ifndef COMMON_TYPES_H
#define COMMON_TYPES_H
-#include <ext/hash_set>
-#include <ext/hash_map>
+#include "hash_structs.hh"
#include <string.h>
#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 <unordered_set>
+#include <unordered_map>
+#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 <unordered_set>
+#include <unordered_map>
+#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 <map>
#include <set>
#include <ext/slist> // Location of STL list extensions
-#include <ext/hash_map> // Location of STL hash extensions
-#include <ext/hash_set> // Location of STL hash extensions
using namespace std;
-using namespace __gnu_cxx; // Required for STL hash extensions
#ifdef USE_RBTREE_SETS