diff options
author | joerg <joerg> | 2013-05-21 16:37:46 +0000 |
---|---|---|
committer | joerg <joerg> | 2013-05-21 16:37:46 +0000 |
commit | 04e241e59de10ede763f32e522ded0ada4cb5de9 (patch) | |
tree | c0fe20cca2c29186f136cccc04861fc467d8c36b /security/HElib/patches | |
parent | ee251ecbe4f9a055c735433f810f26a706c58066 (diff) | |
download | pkgsrc-04e241e59de10ede763f32e522ded0ada4cb5de9.tar.gz |
Support C++11 STL implementations.
Diffstat (limited to 'security/HElib/patches')
-rw-r--r-- | security/HElib/patches/patch-IndexMap.h | 40 | ||||
-rw-r--r-- | security/HElib/patches/patch-NumbTh.h | 24 | ||||
-rw-r--r-- | security/HElib/patches/patch-timing.cpp | 34 |
3 files changed, 98 insertions, 0 deletions
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 |