Skip to content

Commit 1b327da

Browse files
author
Matt Corallo
committed
Fix boost::interprocess::detail::winapi::get_last_bootup_time
This fixes bitcoin#981 and should fix bitcoin#956
1 parent b3dbab3 commit 1b327da

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

contrib/gitian-descriptors/boost-win32.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,32 @@ script: |
1717
mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include
1818
tar xjf boost_1_47_0.tar.bz2
1919
cd boost_1_47_0
20+
echo "--- win32_api.orig.hpp 2012-03-25 16:08:28.932377422 -0400
21+
+++ win32_api.hpp 2012-03-25 16:08:30.312377422 -0400
22+
@@ -1572,14 +1572,21 @@
23+
return ret;
24+
}
25+
26+
+static std::string strLastBootupTimeCache;
27+
inline bool get_last_bootup_time( std::string& str )
28+
{
29+
+ if (strLastBootupTimeCache.size() > 0) {
30+
+ str = strLastBootupTimeCache;
31+
+ return true;
32+
+ }
33+
std::wstring wstr;
34+
bool ret = get_last_bootup_time(wstr);
35+
str.resize(wstr.size());
36+
for(std::size_t i = 0, max = str.size(); i != max; ++i){
37+
str[i] = '0' + (wstr[i]-L'0');
38+
}
39+
+ if (ret)
40+
+ strLastBootupTimeCache = str;
41+
return ret;
42+
}
43+
44+
" > fixbootuptime.patch
45+
patch boost/interprocess/detail/win32_api.hpp fixbootuptime.patch
2046
echo "using gcc : 4.4 : i586-mingw32msvc-g++
2147
:
2248
<rc>i586-mingw32msvc-windres
@@ -34,5 +60,5 @@ script: |
3460
cd $TMPDIR
3561
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
3662
export FAKETIME=$REFERENCE_DATETIME
37-
zip -r boost-win32-1.47.0-gitian.zip *
38-
cp boost-win32-1.47.0-gitian.zip $OUTDIR
63+
zip -r boost-win32-1.47.0-gitian2.zip *
64+
cp boost-win32-1.47.0-gitian2.zip $OUTDIR

contrib/gitian-descriptors/gitian-win32.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ remotes:
1616
"dir": "bitcoin"
1717
files:
1818
- "qt-win32-4.7.4-gitian.zip"
19-
- "boost-win32-1.47.0-gitian.zip"
19+
- "boost-win32-1.47.0-gitian2.zip"
2020
- "bitcoin-deps-0.0.3.zip"
2121
script: |
2222
#
@@ -29,7 +29,7 @@ script: |
2929
mkdir boost_1_47_0
3030
cd boost_1_47_0
3131
mkdir -p stage/lib
32-
unzip ../boost-win32-1.47.0-gitian.zip
32+
unzip ../boost-win32-1.47.0-gitian2.zip
3333
cd bin/$GBUILD_BITS
3434
for lib in *; do
3535
i586-mingw32msvc-ar rc ../../stage/lib/libboost_${lib}-mt-s.a $lib/*.o

0 commit comments

Comments
 (0)