Skip to content
Permalink
Browse files

minisat: Fix build on Darwin

(cherry picked from commit c5b96ca)
  • Loading branch information
edolstra committed Dec 9, 2016
1 parent bdbe680 commit 3727911b46daf32d4ea8f2a2b1072580227e72fe
@@ -0,0 +1,26 @@
https://github.com/fasterthanlime/homebrew-mingw/blob/master/Library/Formula/minisat.rb

diff --git a/utils/System.cc b/utils/System.cc
index a7cf53f..feeaf3c 100644
--- a/utils/System.cc
+++ b/utils/System.cc
@@ -78,16 +78,17 @@ double Minisat::memUsed(void) {
struct rusage ru;
getrusage(RUSAGE_SELF, &ru);
return (double)ru.ru_maxrss / 1024; }
-double MiniSat::memUsedPeak(void) { return memUsed(); }
+double Minisat::memUsedPeak(void) { return memUsed(); }


#elif defined(__APPLE__)
#include <malloc/malloc.h>

-double Minisat::memUsed(void) {
+double Minisat::memUsed() {
malloc_statistics_t t;
malloc_zone_statistics(NULL, &t);
return (double)t.max_size_in_use / (1024*1024); }
+double Minisat::memUsedPeak() { return memUsed(); }

#else
double Minisat::memUsed() {
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
sha256 = "023qdnsb6i18yrrawlhckm47q8x0sl7chpvvw3gssfyw3j2pv5cj";
};

patches = stdenv.lib.optionals stdenv.cc.isClang [ ./clang.diff ];
patches =
[ ./darwin.patch ]
++ stdenv.lib.optionals stdenv.cc.isClang [ ./clang.diff ];

buildInputs = [ zlib ];

0 comments on commit 3727911

Please sign in to comment.
You can’t perform that action at this time.