Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

libstxxl 1.4.0 #27317

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
116 changes: 76 additions & 40 deletions Library/Formula/libstxxl.rb
Expand Up @@ -2,51 +2,87 @@

class Libstxxl < Formula
homepage 'http://stxxl.sourceforge.net/'
url 'https://downloads.sourceforge.net/project/stxxl/stxxl/1.3.1/stxxl-1.3.1.tar.gz'
sha1 '5fba2bb26b919a07e966b2f69ae29aa671892a7d'
url 'https://github.com/stxxl/stxxl/archive/1.4.0.tar.gz'
sha1 '57230314bf136e477d6d96d0f68030af1f652278'

# issue has been rectified in upstream and future 1.4.0 release
def patches; DATA; end if MacOS.version >= :mavericks
depends_on 'cmake' => :build

# compile fixes for 10.7 and 10.8, submitted upstream
# https://github.com/stxxl/stxxl/pull/2
def patches; DATA; end if MacOS.version < :mavericks

def install
ENV['COMPILER'] = ENV.cxx
if MacOS.version >= :mavericks
inreplace 'make.settings.gnu' do |s|
s.gsub! /USE_MACOSX.*no/, 'USE_MACOSX ?= yes#'
s.gsub! /#STXXL_SPECIFIC\s*\+=.*$/, 'STXXL_SPECIFIC += -std=c++0x'
end
mkdir "build" do
system "cmake", "..", "-DCMAKE_BUILD_TYPE=Release"
system "make install"
end
system "make", "config_gnu", "USE_MACOSX=yes"
system "make", "library_g++", "USE_MACOSX=yes"

prefix.install 'include'
lib.install 'lib/libstxxl.a'
end
end

__END__
Index: utils/mlock.cpp
===================================================================
--- stxxl-1.3.1/utils/mlock.cpp (revision 3229)
+++ stxxl-1.3.1/utils/mlock.cpp (working copy)
@@ -18,6 +18,9 @@
#include <iostream>
#include <sys/mman.h>

+#include <chrono>
+#include <thread>
+
int main(int argc, char ** argv)
{
if (argc == 2) {
@@ -28,8 +31,9 @@
c[i] = 42;
if (mlock(c, M) == 0) {
std::cout << "mlock(, " << M << ") successful, press Ctrl-C to finish" << std::endl;
+ std::chrono::seconds duration(86400);
while (1)
- sleep(86400);
+ std::this_thread::sleep_for(duration);
} else {
std::cerr << "mlock(, " << M << ") failed!" << std::endl;
return 1;
diff --git a/include/stxxl/bits/compat/hash_map.h b/include/stxxl/bits/compat/hash_map.h
index d955b31..8c5c365 100644
--- a/include/stxxl/bits/compat/hash_map.h
+++ b/include/stxxl/bits/compat/hash_map.h
@@ -19,7 +19,7 @@
#include <stxxl/bits/config.h>
#include <stxxl/bits/namespace.h>

-#if defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __cplusplus >= 201103L
#include <unordered_map>
#elif STXXL_MSVC
#include <hash_map>
@@ -34,7 +34,7 @@ STXXL_BEGIN_NAMESPACE

template <class _Tp>
struct compat_hash {
-#if defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __cplusplus >= 201103L
typedef std::hash<_Tp> result;
#elif STXXL_MSVC
typedef stdext::hash_compare<_Tp> result;
@@ -48,7 +48,7 @@ struct compat_hash {

template <class _Key, class _Tp, class _Hash = typename compat_hash<_Key>::result>
struct compat_hash_map {
-#if defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __cplusplus >= 201103L
typedef std::unordered_map<_Key, _Tp, _Hash> result;
#elif STXXL_MSVC
typedef stdext::hash_map<_Key, _Tp, _Hash> result;
diff --git a/include/stxxl/bits/compat/type_traits.h b/include/stxxl/bits/compat/type_traits.h
index 08a519e..8ec51be 100644
--- a/include/stxxl/bits/compat/type_traits.h
+++ b/include/stxxl/bits/compat/type_traits.h
@@ -16,7 +16,7 @@
#include <stxxl/bits/config.h>
#include <stxxl/bits/namespace.h>

-#if defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __cplusplus >= 201103L
#include <type_traits>
#elif defined(__GNUG__) && (__GNUC__ >= 4)
#include <tr1/type_traits>
@@ -29,7 +29,7 @@ STXXL_BEGIN_NAMESPACE

namespace compat {

-#if defined(__GXX_EXPERIMENTAL_CXX0X__)
+#if __cplusplus >= 201103L
using std::remove_const;
#elif defined(__GNUG__) && (__GNUC__ >= 4)
using std::tr1::remove_const;
diff --git a/include/stxxl/bits/compat/unique_ptr.h b/include/stxxl/bits/compat/unique_ptr.h
index 7554a0a..e1ecaf0 100644
--- a/include/stxxl/bits/compat/unique_ptr.h
+++ b/include/stxxl/bits/compat/unique_ptr.h
@@ -24,7 +24,7 @@ STXXL_BEGIN_NAMESPACE

template <class _Tp>
struct compat_unique_ptr {
-#if defined(__GXX_EXPERIMENTAL_CXX0X__) && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40400)
+#if __cplusplus >= 201103L && ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40400)
typedef std::unique_ptr<_Tp> result;
#else
// auto_ptr is inherently broken and is deprecated by unique_ptr in c++0x