summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg>2013-05-21 16:37:46 +0000
committerjoerg <joerg>2013-05-21 16:37:46 +0000
commit04e241e59de10ede763f32e522ded0ada4cb5de9 (patch)
treec0fe20cca2c29186f136cccc04861fc467d8c36b
parentee251ecbe4f9a055c735433f810f26a706c58066 (diff)
downloadpkgsrc-04e241e59de10ede763f32e522ded0ada4cb5de9.tar.gz
Support C++11 STL implementations.
-rw-r--r--security/HElib/distinfo5
-rw-r--r--security/HElib/patches/patch-IndexMap.h40
-rw-r--r--security/HElib/patches/patch-NumbTh.h24
-rw-r--r--security/HElib/patches/patch-timing.cpp34
4 files changed, 102 insertions, 1 deletions
diff --git a/security/HElib/distinfo b/security/HElib/distinfo
index 66c915e2f24..449dcddc84a 100644
--- a/security/HElib/distinfo
+++ b/security/HElib/distinfo
@@ -1,6 +1,9 @@
-$NetBSD: distinfo,v 1.1.1.1 2013/05/18 18:36:25 agc Exp $
+$NetBSD: distinfo,v 1.2 2013/05/21 16:37:46 joerg Exp $
SHA1 (HElib-20130501.zip) = 4f10c723eda202442550b89d98da8b9f4fdca013
RMD160 (HElib-20130501.zip) = 729115076c6e90584cf5380694903631764849fb
Size (HElib-20130501.zip) = 2287320 bytes
+SHA1 (patch-IndexMap.h) = f03a5c5d64370a233bf73fd3bff369e32f8a220a
SHA1 (patch-Makefile) = e3a867712039b83f2c49c4dec2e5ff0a6c26f6ac
+SHA1 (patch-NumbTh.h) = f99493989f67d34595bc4e47b159dc75a952b158
+SHA1 (patch-timing.cpp) = 87e2638022326ef9bcb28c8617aa3d8d34c3aa85
diff --git a/security/HElib/patches/patch-IndexMap.h b/security/HElib/patches/patch-IndexMap.h
new file mode 100644
index 00000000000..cc53b535c6a
--- /dev/null
+++ b/security/HElib/patches/patch-IndexMap.h
@@ -0,0 +1,40 @@
+$NetBSD: patch-IndexMap.h,v 1.1 2013/05/21 16:37:46 joerg Exp $
+
+--- IndexMap.h.orig 2013-05-21 14:44:35.000000000 +0000
++++ IndexMap.h
+@@ -21,9 +21,14 @@
+ **/
+
+ #include "IndexSet.h"
+-#include <tr1/unordered_map>
+ #include <iostream>
+ #include <cassert>
++#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
++#include <unordered_map>
++#else
++#include <tr1/unordered_map>
++using std::tr1::unordered_map;
++#endif
+ #include "cloned_ptr.h"
+
+ using namespace std;
+@@ -46,7 +51,7 @@ public:
+ //! flexible manner.
+ template < class T > class IndexMap {
+
+- tr1::unordered_map<long, T> map;
++ unordered_map<long, T> map;
+ IndexSet indexSet;
+ cloned_ptr< IndexMapInit<T> > init;
+
+@@ -78,8 +83,8 @@ public:
+ assert(indexSet.contains(j));
+ // unordered_map does not support a const [] operator,
+ // so we have to artificially strip away the const-ness here
+- tr1::unordered_map<long, T> & map1 =
+- const_cast< tr1::unordered_map<long, T> & > (map);
++ unordered_map<long, T> & map1 =
++ const_cast< unordered_map<long, T> & > (map);
+ return map1[j];
+ }
+
diff --git a/security/HElib/patches/patch-NumbTh.h b/security/HElib/patches/patch-NumbTh.h
new file mode 100644
index 00000000000..37dca104b57
--- /dev/null
+++ b/security/HElib/patches/patch-NumbTh.h
@@ -0,0 +1,24 @@
+$NetBSD: patch-NumbTh.h,v 1.1 2013/05/21 16:37:46 joerg Exp $
+
+--- NumbTh.h.orig 2013-05-21 14:43:10.000000000 +0000
++++ NumbTh.h
+@@ -32,13 +32,18 @@
+ #include <NTL/mat_GF2E.h>
+ #include <NTL/lzz_pXFactoring.h>
+ #include <NTL/GF2XFactoring.h>
++#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
++#include <unordered_map>
++#else
+ #include <tr1/unordered_map>
++using std::tr1::unordered_map;
++#endif
+ #include <string>
+ NTL_CLIENT
+
+
+ //! @typedef
+-typedef tr1::unordered_map<string, const char *> argmap_t;
++typedef unordered_map<string, const char *> argmap_t;
+
+
+ //! @brief Code for parsing command line arguments.
diff --git a/security/HElib/patches/patch-timing.cpp b/security/HElib/patches/patch-timing.cpp
new file mode 100644
index 00000000000..f8446654394
--- /dev/null
+++ b/security/HElib/patches/patch-timing.cpp
@@ -0,0 +1,34 @@
+$NetBSD: patch-timing.cpp,v 1.1 2013/05/21 16:37:46 joerg Exp $
+
+--- timing.cpp.orig 2013-05-21 14:42:27.000000000 +0000
++++ timing.cpp
+@@ -16,13 +16,19 @@
+ #include <ctime>
+ #include <iostream>
+ #include "timing.h"
+-#include <tr1/unordered_map>
+ #include <vector>
+ #include <algorithm>
+ #include <utility>
+ #include <cmath>
+ #include <cstring>
+
++#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
++#include <unordered_map>
++#else
++#include <tr1/unordered_map>
++using std::tr1::unordered_map;
++#endif
++
+ using namespace std;
+
+ //! A simple class to toggle timing information on and off
+@@ -43,7 +49,7 @@ bool string_compare(const char *a, const
+
+ bool FHEtimersOn=false;
+
+-typedef tr1::unordered_map<const char*,FHEtimer>timerMap;
++typedef unordered_map<const char*,FHEtimer>timerMap;
+ static timerMap timers;
+
+ // Reset a timer for some label to zero