summaryrefslogtreecommitdiff
path: root/databases/cstore
diff options
context:
space:
mode:
authorwiz <wiz>2011-12-20 13:42:47 +0000
committerwiz <wiz>2011-12-20 13:42:47 +0000
commit53ba2dbcfdff24cdfa399843050fd78920632582 (patch)
tree290d784218412c25e7c61ac099e9587b504257a5 /databases/cstore
parentdd6bdd3a699f6484dee8ab486b32ad5c91707b08 (diff)
downloadpkgsrc-53ba2dbcfdff24cdfa399843050fd78920632582.tar.gz
Add a some missing header files and fix a cast.
Adapt for db4 update post 4.5. Now dies with segfault during build: terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr [1] Abort trap (core dumped) ./cstoreqptest 0...
Diffstat (limited to 'databases/cstore')
-rw-r--r--databases/cstore/distinfo65
-rw-r--r--databases/cstore/patches/patch-aa4
-rw-r--r--databases/cstore/patches/patch-aj14
-rw-r--r--databases/cstore/patches/patch-ak20
-rw-r--r--databases/cstore/patches/patch-al20
-rw-r--r--databases/cstore/patches/patch-src_AM_CatalogInstance.cpp14
-rw-r--r--databases/cstore/patches/patch-src_AM_PageWriter.cpp14
-rw-r--r--databases/cstore/patches/patch-src_AM_ROSAM.cpp14
-rw-r--r--databases/cstore/patches/patch-src_AM_ROSWOSSegment.cpp14
-rw-r--r--databases/cstore/patches/patch-src_AM_WSMV.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Operators_ColumnExtracter.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Operators_HashJoin.h15
-rw-r--r--databases/cstore/patches/patch-src_Operators_MinicolConcat.h15
-rw-r--r--databases/cstore/patches/patch-src_Operators_NLJoin.h15
-rw-r--r--databases/cstore/patches/patch-src_Operators_SColumnExtracter.cpp14
-rw-r--r--databases/cstore/patches/patch-src_TM_WosTupleIter.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_BDBPerformanceProfile.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_BDBReadWrite.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_DeltaPosWriterTest.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_HashMapTest.cpp41
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_IntEncodeDecodeTest.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_IntReaderWriterTest.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_LZED.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_LZEncodeDecode.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_MergeTest.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_NSEncodeDecode.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_PosBlockTest.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_Queries.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecode.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecodeII.cpp14
-rw-r--r--databases/cstore/patches/patch-src_UnitTests_Type2WriterTest.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_Encoder_BitSparseEncoder.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_Encoder_LZEncoder.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_Encoder_RangeSparseEncoder.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_Encoder_SparseEncoder.cpp14
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_MultiBlock.h15
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_PosArrayBlock.h15
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_PosBasicBlock.h16
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_SMultiBlock.h15
-rw-r--r--databases/cstore/patches/patch-src_Wrappers_SparseBlock.h15
-rw-r--r--databases/cstore/patches/patch-src_common_BlockWithPos.h16
-rw-r--r--databases/cstore/patches/patch-src_common_MinicolBlock.h15
-rw-r--r--databases/cstore/patches/patch-src_common_PosBlockArray.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_Dict2DataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_DictCPU2DataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_Int2DataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_JoinExpDataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.cpp15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_LZDataMaker.cpp15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_NS2DataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_RLE2DataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_compressionexps_SelExpDataMaker.h15
-rw-r--r--databases/cstore/patches/patch-src_materialexps_PosAndEM.cpp14
-rw-r--r--databases/cstore/patches/patch-src_materialexps_PosAndLM.cpp14
-rw-r--r--databases/cstore/patches/patch-src_materialexps_PosAndMC.cpp12
-rw-r--r--databases/cstore/patches/patch-src_plan_Node.h15
-rw-r--r--databases/cstore/patches/patch-src_plan_Nodes_SelectNode.cpp14
-rw-r--r--databases/cstore/patches/patch-src_sparseexps_SelExpDM.h15
-rw-r--r--databases/cstore/patches/patch-src_sparseexps_StrSelExpDM.h15
60 files changed, 922 insertions, 22 deletions
diff --git a/databases/cstore/distinfo b/databases/cstore/distinfo
index 5ec7c4df89b..c553c541fda 100644
--- a/databases/cstore/distinfo
+++ b/databases/cstore/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
+$NetBSD: distinfo,v 1.2 2011/12/20 13:42:47 wiz Exp $
SHA1 (D6.data.ros.gz) = 3efe5c0b4675dcdc2c89cf9a1b6f305663d153a5
RMD160 (D6.data.ros.gz) = 20b99b066b953424dcb0b5435e9731806fac5d52
@@ -9,7 +9,7 @@ Size (cstore0.2.tar.gz) = 4292918 bytes
SHA1 (data4.tar.gz) = aa07edc8a13bb194774af49cd6a1f5a95574aefd
RMD160 (data4.tar.gz) = 9914cae55abfef9d880f14a004f4f608180ec905
Size (data4.tar.gz) = 1348695152 bytes
-SHA1 (patch-aa) = 52f482fa451a16f85c727cd9953510ccb04836ab
+SHA1 (patch-aa) = 2a37550c253298dc30dff537050766ddf04896a3
SHA1 (patch-ab) = 92bb9855f834ffb7b54f0ca99efd8f1bf3c9c65e
SHA1 (patch-ac) = b495ba01f725c3b35ac1cd92a640a5978510dc19
SHA1 (patch-ad) = 4abd94414fb16281db481626a048fcd12d38a3eb
@@ -18,9 +18,64 @@ SHA1 (patch-af) = 8dbdc8d20bc56643a86bcbdff7ee631daadbad9a
SHA1 (patch-ag) = eb72568f71ec1372e0b69cad3e8b2f7d830597e4
SHA1 (patch-ah) = fca6811c7a53662e5cf41956867b39c974a96876
SHA1 (patch-ai) = a294ac30adf46ec031925363a0174c8dcd8b4c2a
-SHA1 (patch-aj) = d99dfbd23487bce2ae97f48474790d341437d7d4
-SHA1 (patch-ak) = 3c57bc19f340b49e88b4ae605cb0e04ec8f3a0ce
-SHA1 (patch-al) = a0683ed97a61438bfa4cae734955905cc97d6410
+SHA1 (patch-aj) = bdf1608656d2083bf0bb590942fb4f9ea0107c4e
+SHA1 (patch-ak) = 6327d5bd5ec8f64ac5edd5f458ae1ee041bbfaa5
+SHA1 (patch-al) = 8836e1c3925fe07d3fbe90122734e9c442fa0383
SHA1 (patch-ao) = ad649ccb0c599b8ad46ba7120d0b074e7eabda27
SHA1 (patch-ap) = c7058ab97051c8421e26344431929fb420ca0076
SHA1 (patch-aq) = 827992abf73b976d9ac2dd121d14212f7a61452c
+SHA1 (patch-src_AM_CatalogInstance.cpp) = a32311603148df5219aa71dbc8fb0e8900a19cc8
+SHA1 (patch-src_AM_PageWriter.cpp) = 158bbb137bffb46abd9fc6713c03db2c387c009c
+SHA1 (patch-src_AM_ROSAM.cpp) = b3f194bdafb86abd44eaeb69357792febad69c64
+SHA1 (patch-src_AM_ROSWOSSegment.cpp) = 10e85a9dcc5b8e9d5d8368b5aa04c0dd72c5c076
+SHA1 (patch-src_AM_WSMV.cpp) = ee36161d9a31fc3c9ab994cbcd37bb7de766daa8
+SHA1 (patch-src_Operators_ColumnExtracter.cpp) = 20773712242d7992ff81166eff8c503e5298b752
+SHA1 (patch-src_Operators_HashJoin.h) = 089ef9b50fbb29a09d7e542346535287a8b8d381
+SHA1 (patch-src_Operators_MinicolConcat.h) = 19a294484b6cb8232dce4f49a90effc020a2f016
+SHA1 (patch-src_Operators_NLJoin.h) = e17bed875a7acccb06caeb288767524c645987bc
+SHA1 (patch-src_Operators_SColumnExtracter.cpp) = 7f0f36563ae10d78e4d5226e67a62aca51587a85
+SHA1 (patch-src_TM_WosTupleIter.cpp) = 5503e602c6da6ef917efa5957e60d72b68293033
+SHA1 (patch-src_UnitTests_BDBPerformanceProfile.cpp) = d15969cb8da4847ee2e85bdf5ef20f9b4a16472b
+SHA1 (patch-src_UnitTests_BDBReadWrite.cpp) = 615dd95cb9765fc4d0d5d3c8f83b8f222296e779
+SHA1 (patch-src_UnitTests_DeltaPosWriterTest.cpp) = 6255ec2f1daa64018ee5ff957293b67e70342544
+SHA1 (patch-src_UnitTests_HashMapTest.cpp) = c226cce1438410468d0ae749acd719cc2a14514f
+SHA1 (patch-src_UnitTests_IntEncodeDecodeTest.cpp) = 9eecbf69cbf23fb1208f53df7efbe90fce5d38ed
+SHA1 (patch-src_UnitTests_IntReaderWriterTest.cpp) = d84bbbef02f99741f623dc4be9ad2f1a45205e7d
+SHA1 (patch-src_UnitTests_LZED.cpp) = 40ef27105aa88a51b27c1a4af009bb2e7d9c0739
+SHA1 (patch-src_UnitTests_LZEncodeDecode.cpp) = 46af97873effdd5327e2a48b58d09053174845d7
+SHA1 (patch-src_UnitTests_MergeTest.cpp) = 86b698ef45f6397c18c3b9257d882c861d0dfc6e
+SHA1 (patch-src_UnitTests_NSEncodeDecode.cpp) = 441fc1b8679fffe02ea1752d3650d340cd4933b8
+SHA1 (patch-src_UnitTests_PosBlockTest.cpp) = bfb2ffcab50b967fa57826939d49e715edb887dc
+SHA1 (patch-src_UnitTests_Queries.cpp) = 9a0908350088aae8b4fd8373e23a958895983f8e
+SHA1 (patch-src_UnitTests_RLEEncodeDecode.cpp) = a19cc964cac7ece9ae94760aeb598e288704c594
+SHA1 (patch-src_UnitTests_RLEEncodeDecodeII.cpp) = 4d218b48f9354728b412e636d9ae4c2976128838
+SHA1 (patch-src_UnitTests_Type2WriterTest.cpp) = de1136fa3aaecbb90413c3b77596f0f1616faf0f
+SHA1 (patch-src_Wrappers_Encoder_BitSparseEncoder.cpp) = 5e2edc91e3deaf956ac66d3236fc2472ef407b0e
+SHA1 (patch-src_Wrappers_Encoder_LZEncoder.cpp) = 9461b67660cc0dbe185c7d25f2029153bcdae6f2
+SHA1 (patch-src_Wrappers_Encoder_RangeSparseEncoder.cpp) = da02bcdc03d880da0e3fb2bed89ef1eae991819d
+SHA1 (patch-src_Wrappers_Encoder_SparseEncoder.cpp) = 75896515063014b143d89a2b6a8115448c5927be
+SHA1 (patch-src_Wrappers_MultiBlock.h) = 769878e9d4ac42c5c15f14529969a19f31a1c575
+SHA1 (patch-src_Wrappers_PosArrayBlock.h) = 14500febe816a25cc70d8bd3bf87f06edc6bc602
+SHA1 (patch-src_Wrappers_PosBasicBlock.h) = f69257842706102944ca61c32ea43644d00568c1
+SHA1 (patch-src_Wrappers_SMultiBlock.h) = f4cde96cf1dda37e10ee8a756f28c07aa72821cf
+SHA1 (patch-src_Wrappers_SparseBlock.h) = 4d4a3aa4d7d96b4609c922fc785d8e53815152eb
+SHA1 (patch-src_common_BlockWithPos.h) = 42a714eb32bd587fc8e882f0fc2cc694c45120ae
+SHA1 (patch-src_common_MinicolBlock.h) = cae06f3bcaac900532e95014033bfdfa17ca15e1
+SHA1 (patch-src_common_PosBlockArray.h) = 90dbdfa114064c5351169e3538e269c630a13888
+SHA1 (patch-src_compressionexps_Dict2DataMaker.h) = 9b6e59fe63496e9c1b443fbe1302fa3e35080f2e
+SHA1 (patch-src_compressionexps_DictCPU2DataMaker.h) = 8873c80c191d09e6d140cba6cb3fc70015679f06
+SHA1 (patch-src_compressionexps_Int2DataMaker.h) = 25f316d0a42391a6c0cd876b44e8a548be47f03d
+SHA1 (patch-src_compressionexps_JoinExpDataMaker.h) = 698ee59cb1e57adf0458ce85cc66fcc4cd857e1a
+SHA1 (patch-src_compressionexps_LZ2DataMaker.cpp) = 6149ef7217109ac3b794076e2402f598843e94f2
+SHA1 (patch-src_compressionexps_LZ2DataMaker.h) = de969c13a934aff7bc4411408527dbf056231a5f
+SHA1 (patch-src_compressionexps_LZDataMaker.cpp) = cb3710d66e61020dc20fba87188847a3414b375e
+SHA1 (patch-src_compressionexps_NS2DataMaker.h) = d946607b7f50e8a3efadd6ca9d54fbb080532927
+SHA1 (patch-src_compressionexps_RLE2DataMaker.h) = 330c77c410dafc50d4447abe5cec9e6b4b6ad481
+SHA1 (patch-src_compressionexps_SelExpDataMaker.h) = c624b46e12c0afc34e076220e3f106f8dd1cb1e2
+SHA1 (patch-src_materialexps_PosAndEM.cpp) = 8a0dcc1c4cc452f74bc3b1dc0aed9673426faa21
+SHA1 (patch-src_materialexps_PosAndLM.cpp) = 40ea2dc504e1264a83b8c4a8f52cefedcbb615db
+SHA1 (patch-src_materialexps_PosAndMC.cpp) = 7981bd52604b10b26aa68e3cca231209e3aa5ca6
+SHA1 (patch-src_plan_Node.h) = b60068d6c1542f3cee82d468510b0a4fa0add6e6
+SHA1 (patch-src_plan_Nodes_SelectNode.cpp) = 7fe05ea193da588ca6727da16ea5fe73ab57fc0b
+SHA1 (patch-src_sparseexps_SelExpDM.h) = 1afe37b5aa2ba86be34cabae25215d61fd391cb2
+SHA1 (patch-src_sparseexps_StrSelExpDM.h) = 535dc0f2ad7c4787505640917a9e0e858af0ac64
diff --git a/databases/cstore/patches/patch-aa b/databases/cstore/patches/patch-aa
index 33920fcf551..14607b5d6b7 100644
--- a/databases/cstore/patches/patch-aa
+++ b/databases/cstore/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
+$NetBSD: patch-aa,v 1.2 2011/12/20 13:42:47 wiz Exp $
--- Build/makefile.init 2007/10/01 11:20:34 1.1
+++ Build/makefile.init 2007/10/01 11:24:09
@@ -27,7 +27,7 @@ $NetBSD: patch-aa,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
+LFLAGS := -L$(SLEEPYCAT_LIB) -L$(LZO_LIB) -Wl,-R$(SLEEPYCAT_LIB) -Wl,-R$(LZO_LIB)
OPTS := -Wl,--demangle
-LIBS := -ldb-4.2 -ldb_cxx-4.2 -lpthread -llzo
-+LIBS := -ldb4-4.5 -ldb4_cxx-4.5 -lpthread -llzo2
++LIBS := -ldb4 -ldb4_cxx -lpthread -llzo2
#override OPTS with gprof flags
ifdef __CSTORE_GPROF__
OPTS := -pg -Wl,--demangle
diff --git a/databases/cstore/patches/patch-aj b/databases/cstore/patches/patch-aj
index e83386694d2..ca351c7609d 100644
--- a/databases/cstore/patches/patch-aj
+++ b/databases/cstore/patches/patch-aj
@@ -1,9 +1,13 @@
-$NetBSD: patch-aj,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
+$NetBSD: patch-aj,v 1.2 2011/12/20 13:42:47 wiz Exp $
---- src/Wrappers/PosArrayBlock.cpp 2007/11/07 20:58:59 1.1
-+++ src/Wrappers/PosArrayBlock.cpp 2007/11/07 20:59:17
-@@ -1,3 +1,4 @@
+--- src/Wrappers/PosArrayBlock.cpp.orig 2006-09-19 21:47:50.000000000 +0000
++++ src/Wrappers/PosArrayBlock.cpp
+@@ -1,5 +1,7 @@
+#include <cassert>
#include "PosArrayBlock.h"
- #include <iostream.h>
+-#include <iostream.h>
++#include <iostream>
++#include <string.h>
+ PosArrayBlock::PosArrayBlock(int capacity)
+ {
diff --git a/databases/cstore/patches/patch-ak b/databases/cstore/patches/patch-ak
index 21dd1bc0314..164ee8095c7 100644
--- a/databases/cstore/patches/patch-ak
+++ b/databases/cstore/patches/patch-ak
@@ -1,8 +1,20 @@
-$NetBSD: patch-ak,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
+$NetBSD: patch-ak,v 1.2 2011/12/20 13:42:47 wiz Exp $
---- src/Util/StopWatch.cpp 2007/11/07 21:13:19 1.1
-+++ src/Util/StopWatch.cpp 2007/11/07 21:19:10
-@@ -52,6 +52,11 @@
+--- src/Util/StopWatch.cpp.orig 2005-09-23 06:14:58.000000000 +0000
++++ src/Util/StopWatch.cpp
+@@ -33,8 +33,9 @@
+
+
+ #include "StopWatch.h"
+-#include <fstream.h>
+-#include <iostream.h>
++#include <fstream>
++#include <iostream>
++using namespace std;
+
+ StopWatch::StopWatch()
+ {
+@@ -52,6 +53,11 @@ void StopWatch::start() {
r1 = times(&t);
}
diff --git a/databases/cstore/patches/patch-al b/databases/cstore/patches/patch-al
index 9207ae034ea..24f2af617cd 100644
--- a/databases/cstore/patches/patch-al
+++ b/databases/cstore/patches/patch-al
@@ -1,8 +1,16 @@
-$NetBSD: patch-al,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
+$NetBSD: patch-al,v 1.2 2011/12/20 13:42:47 wiz Exp $
---- src/Util/BDBFile.cpp 2007/11/07 21:22:30 1.1
-+++ src/Util/BDBFile.cpp 2007/11/07 21:37:32
-@@ -275,6 +275,7 @@
+--- src/Util/BDBFile.cpp.orig 2005-07-09 06:23:41.000000000 +0000
++++ src/Util/BDBFile.cpp
+@@ -32,6 +32,7 @@
+ #include <fstream>
+ #include <sstream>
+ #include <string>
++#include <string.h>
+ #include <map>
+ #include <math.h>
+ #include <cassert>
+@@ -275,6 +276,7 @@ void BDBFile::closeCursor()
void BDBFile::showStats()
{
@@ -10,7 +18,7 @@ $NetBSD: patch-al,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
DB_BTREE_STAT *pStat;
dbHandle->stat(&pStat, 0);
-@@ -284,10 +285,12 @@
+@@ -284,10 +286,12 @@ void BDBFile::showStats()
cout << bdbFileName << " contains "
<< pStat->bt_ndata << " records\n";
free(pStat);
@@ -23,7 +31,7 @@ $NetBSD: patch-al,v 1.1.1.1 2007/11/10 11:33:00 agc Exp $
DB_BTREE_STAT *pStat;
dbHandle->stat(&pStat, 0);
-@@ -297,6 +300,7 @@
+@@ -297,6 +301,7 @@ u_long BDBFile::getRecordCount()
u_long cnt = pStat->bt_ndata;
free(pStat);
return cnt;
diff --git a/databases/cstore/patches/patch-src_AM_CatalogInstance.cpp b/databases/cstore/patches/patch-src_AM_CatalogInstance.cpp
new file mode 100644
index 00000000000..d22dffa4404
--- /dev/null
+++ b/databases/cstore/patches/patch-src_AM_CatalogInstance.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_AM_CatalogInstance.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/AM/CatalogInstance.cpp.orig 2006-10-18 06:05:29.000000000 +0000
++++ src/AM/CatalogInstance.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include <iostream>
++#include <stdlib.h>
+ #include "CatalogInstance.h"
+ #include "CatalogInstanceBDB.h"
+
diff --git a/databases/cstore/patches/patch-src_AM_PageWriter.cpp b/databases/cstore/patches/patch-src_AM_PageWriter.cpp
new file mode 100644
index 00000000000..cccbd37a2f4
--- /dev/null
+++ b/databases/cstore/patches/patch-src_AM_PageWriter.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_AM_PageWriter.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/AM/PageWriter.cpp.orig 2006-09-07 23:41:23.000000000 +0000
++++ src/AM/PageWriter.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include <iostream>
++#include <stdlib.h>
+ #include <fstream>
+ #include <sstream>
+ #include <string>
diff --git a/databases/cstore/patches/patch-src_AM_ROSAM.cpp b/databases/cstore/patches/patch-src_AM_ROSAM.cpp
new file mode 100644
index 00000000000..c2ad234892c
--- /dev/null
+++ b/databases/cstore/patches/patch-src_AM_ROSAM.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_AM_ROSAM.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/AM/ROSAM.cpp.orig 2006-09-20 15:01:44.000000000 +0000
++++ src/AM/ROSAM.cpp
+@@ -30,6 +30,7 @@
+ */
+ //#include <iostream>
+ #include <fstream>
++#include <stdlib.h>
+ #include <sstream>
+ #include <strstream>
+
diff --git a/databases/cstore/patches/patch-src_AM_ROSWOSSegment.cpp b/databases/cstore/patches/patch-src_AM_ROSWOSSegment.cpp
new file mode 100644
index 00000000000..bbb6b138ff1
--- /dev/null
+++ b/databases/cstore/patches/patch-src_AM_ROSWOSSegment.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_AM_ROSWOSSegment.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/AM/ROSWOSSegment.cpp.orig 2006-10-18 06:05:29.000000000 +0000
++++ src/AM/ROSWOSSegment.cpp
+@@ -32,6 +32,7 @@
+ #include <fstream>
+ #include <sstream>
+ #include <strstream>
++#include <stdlib.h>
+
+ #include <db_cxx.h>
+
diff --git a/databases/cstore/patches/patch-src_AM_WSMV.cpp b/databases/cstore/patches/patch-src_AM_WSMV.cpp
new file mode 100644
index 00000000000..7da0920a0ed
--- /dev/null
+++ b/databases/cstore/patches/patch-src_AM_WSMV.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_AM_WSMV.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/AM/WSMV.cpp.orig 2005-07-06 04:06:24.000000000 +0000
++++ src/AM/WSMV.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include <iostream>
++#include <stdlib.h>
+ #include <fstream>
+ #include <sstream>
+ #include <string>
diff --git a/databases/cstore/patches/patch-src_Operators_ColumnExtracter.cpp b/databases/cstore/patches/patch-src_Operators_ColumnExtracter.cpp
new file mode 100644
index 00000000000..09c2b72f0e4
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Operators_ColumnExtracter.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_Operators_ColumnExtracter.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Operators/ColumnExtracter.cpp.orig 2006-08-20 20:43:49.000000000 +0000
++++ src/Operators/ColumnExtracter.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "ColumnExtracter.h"
++#include <stdlib.h>
+
+ ColumnExtracter::ColumnExtracter(string fileName, int c_index, bool FORCE_REBUILD)
+ {
diff --git a/databases/cstore/patches/patch-src_Operators_HashJoin.h b/databases/cstore/patches/patch-src_Operators_HashJoin.h
new file mode 100644
index 00000000000..a5c2803d6a5
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Operators_HashJoin.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Operators_HashJoin.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Operators/HashJoin.h.orig 2006-09-29 18:20:44.000000000 +0000
++++ src/Operators/HashJoin.h
+@@ -44,7 +44,7 @@
+ #include "../Wrappers/MultiBlock.h"
+ #include "../Util/HashMap.h"
+ #include <math.h>
+-#include <hash_map.h>
++#include <hash_map>
+
+ class PBObject {
+ public:
diff --git a/databases/cstore/patches/patch-src_Operators_MinicolConcat.h b/databases/cstore/patches/patch-src_Operators_MinicolConcat.h
new file mode 100644
index 00000000000..2146b318e25
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Operators_MinicolConcat.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Operators_MinicolConcat.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Operators/MinicolConcat.h.orig 2006-02-25 20:26:25.000000000 +0000
++++ src/Operators/MinicolConcat.h
+@@ -5,7 +5,7 @@
+ #include "../common/MinicolBlock.h"
+ #include "../common/UnexpectedException.h"
+ #include <stack>
+-#include <list.h>
++#include <list>
+
+ class MinicolConcat : public Operator
+ {
diff --git a/databases/cstore/patches/patch-src_Operators_NLJoin.h b/databases/cstore/patches/patch-src_Operators_NLJoin.h
new file mode 100644
index 00000000000..5cd84ea0690
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Operators_NLJoin.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Operators_NLJoin.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Operators/NLJoin.h.orig 2006-08-20 20:43:49.000000000 +0000
++++ src/Operators/NLJoin.h
+@@ -43,7 +43,7 @@
+ #include "../Wrappers/SMultiBlock.h"
+ #include "../Wrappers/MultiBlock.h"
+ #include <math.h>
+-#include <hash_map.h>
++#include <hash_map>
+
+ class NLJoin : public Operator {
+
diff --git a/databases/cstore/patches/patch-src_Operators_SColumnExtracter.cpp b/databases/cstore/patches/patch-src_Operators_SColumnExtracter.cpp
new file mode 100644
index 00000000000..dbb130510d9
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Operators_SColumnExtracter.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_Operators_SColumnExtracter.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Operators/SColumnExtracter.cpp.orig 2006-08-22 22:31:39.000000000 +0000
++++ src/Operators/SColumnExtracter.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "SColumnExtracter.h"
++#include <stdlib.h>
+
+ SColumnExtracter::SColumnExtracter(string fileName, int c_index, int stringSize_, bool FORCE_REBUILD)
+ {
diff --git a/databases/cstore/patches/patch-src_TM_WosTupleIter.cpp b/databases/cstore/patches/patch-src_TM_WosTupleIter.cpp
new file mode 100644
index 00000000000..4f22f59ac46
--- /dev/null
+++ b/databases/cstore/patches/patch-src_TM_WosTupleIter.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_TM_WosTupleIter.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/TM/WosTupleIter.cpp.orig 2005-07-06 04:06:24.000000000 +0000
++++ src/TM/WosTupleIter.cpp
+@@ -35,6 +35,7 @@
+ */
+
+ #include <string>
++#include <stdlib.h>
+ #include <vector>
+
+ #include "WosTuple.h" //tuple representation of WOS projection
diff --git a/databases/cstore/patches/patch-src_UnitTests_BDBPerformanceProfile.cpp b/databases/cstore/patches/patch-src_UnitTests_BDBPerformanceProfile.cpp
new file mode 100644
index 00000000000..a32116f3495
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_BDBPerformanceProfile.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_BDBPerformanceProfile.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/BDBPerformanceProfile.cpp.orig 2006-10-18 06:04:35.000000000 +0000
++++ src/UnitTests/BDBPerformanceProfile.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "BDBPerformanceProfile.h"
++#include <stdlib.h>
+
+ BDBPerformanceProfile::BDBPerformanceProfile()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_BDBReadWrite.cpp b/databases/cstore/patches/patch-src_UnitTests_BDBReadWrite.cpp
new file mode 100644
index 00000000000..263d5b9ec8e
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_BDBReadWrite.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_BDBReadWrite.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/BDBReadWrite.cpp.orig 2006-10-18 06:04:35.000000000 +0000
++++ src/UnitTests/BDBReadWrite.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "BDBReadWrite.h"
++#include <stdlib.h>
+
+ BDBReadWrite::BDBReadWrite()
+ {}
diff --git a/databases/cstore/patches/patch-src_UnitTests_DeltaPosWriterTest.cpp b/databases/cstore/patches/patch-src_UnitTests_DeltaPosWriterTest.cpp
new file mode 100644
index 00000000000..9e673a29908
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_DeltaPosWriterTest.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_DeltaPosWriterTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/DeltaPosWriterTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/DeltaPosWriterTest.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "DeltaPosWriterTest.h"
++#include <stdlib.h>
+
+ DeltaPosWriterTest::DeltaPosWriterTest()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_HashMapTest.cpp b/databases/cstore/patches/patch-src_UnitTests_HashMapTest.cpp
new file mode 100644
index 00000000000..115639346a7
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_HashMapTest.cpp
@@ -0,0 +1,41 @@
+$NetBSD: patch-src_UnitTests_HashMapTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Avoid cast error.
+
+--- src/UnitTests/HashMapTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/HashMapTest.cpp
+@@ -52,27 +52,27 @@ bool HashMapTest::run(Globals *g, const
+ map->put(&z, (void*)b, sizeof(int));
+
+
+- if ((int)map->get(&x) != c) return false;
+- if ((int)map->get(&y) != d) return false;
+- if ((int)map->get(&z) != b) return false;
++ if ((int64_t)map->get(&x) != c) return false;
++ if ((int64_t)map->get(&y) != d) return false;
++ if ((int64_t)map->get(&z) != b) return false;
+ if (map->getDataSize() != 3*sizeof(int)) return false;
+ if (map->getNumKeys() != 3) return false;
+
+ map->put(&x, (void*)a, sizeof(int));
+- if ((int)map->get(&x) != a) { return false; }
++ if ((int64_t)map->get(&x) != a) { return false; }
+ if (map->getDataSize() != 3*sizeof(int)) return false;
+
+ if (map->getNumKeys() != 3) return false;
+
+ map->put(&w, (void*)c, sizeof(int));
+- if ((int)map->get(&x) != a) return false;
+- if ((int)map->get(&w) != c) return false;
++ if ((int64_t)map->get(&x) != a) return false;
++ if ((int64_t)map->get(&w) != c) return false;
+ if (map->getDataSize() != 4*sizeof(int)) return false;
+ if (map->getNumKeys() != 4) return false;
+
+ for (int i = 0; i < 4; i++) {
+ ValPos* k = map->getKey()->clone();
+- int a = (int)map->remove(k);
++ int a = (int64_t)map->remove(k);
+ cout << "HashMap: iterated over (" << *(int*)k->value << "," << a << ")\n";
+ delete k;
+ //cout << "NumKeys: " << map->getNumKeys() << "\n";
diff --git a/databases/cstore/patches/patch-src_UnitTests_IntEncodeDecodeTest.cpp b/databases/cstore/patches/patch-src_UnitTests_IntEncodeDecodeTest.cpp
new file mode 100644
index 00000000000..454de649944
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_IntEncodeDecodeTest.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_IntEncodeDecodeTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/IntEncodeDecodeTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/IntEncodeDecodeTest.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "IntEncodeDecodeTest.h"
++#include <stdlib.h>
+
+ IntEncodeDecodeTest::IntEncodeDecodeTest()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_IntReaderWriterTest.cpp b/databases/cstore/patches/patch-src_UnitTests_IntReaderWriterTest.cpp
new file mode 100644
index 00000000000..bfa8bf7a6a7
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_IntReaderWriterTest.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_IntReaderWriterTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/IntReaderWriterTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/IntReaderWriterTest.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "IntReaderWriterTest.h"
++#include <stdlib.h>
+
+ IntReaderWriterTest::IntReaderWriterTest()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_LZED.cpp b/databases/cstore/patches/patch-src_UnitTests_LZED.cpp
new file mode 100644
index 00000000000..340645a2320
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_LZED.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_LZED.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/LZED.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/LZED.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "LZED.h"
++#include <stdlib.h>
+
+ LZED::LZED()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_LZEncodeDecode.cpp b/databases/cstore/patches/patch-src_UnitTests_LZEncodeDecode.cpp
new file mode 100644
index 00000000000..9c153bcf5ef
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_LZEncodeDecode.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_LZEncodeDecode.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/LZEncodeDecode.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/LZEncodeDecode.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "LZEncodeDecode.h"
++#include <stdlib.h>
+
+
+ LZEncodeDecode::LZEncodeDecode()
diff --git a/databases/cstore/patches/patch-src_UnitTests_MergeTest.cpp b/databases/cstore/patches/patch-src_UnitTests_MergeTest.cpp
new file mode 100644
index 00000000000..992d5ef7985
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_MergeTest.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_MergeTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/MergeTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/MergeTest.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "MergeTest.h"
++#include <stdlib.h>
+
+ MergeTest::MergeTest() {}
+
diff --git a/databases/cstore/patches/patch-src_UnitTests_NSEncodeDecode.cpp b/databases/cstore/patches/patch-src_UnitTests_NSEncodeDecode.cpp
new file mode 100644
index 00000000000..de91fabe65f
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_NSEncodeDecode.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_NSEncodeDecode.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/NSEncodeDecode.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/NSEncodeDecode.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "NSEncodeDecode.h"
++#include <stdlib.h>
+
+ NSEncodeDecode::NSEncodeDecode()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_PosBlockTest.cpp b/databases/cstore/patches/patch-src_UnitTests_PosBlockTest.cpp
new file mode 100644
index 00000000000..9679feb5512
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_PosBlockTest.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_PosBlockTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/PosBlockTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/PosBlockTest.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "PosBlockTest.h"
++#include <stdlib.h>
+ // Tests all Position Blocks (RLE, Delta, and Bit)
+ // Tests Writers and Blocks
+ // Problems: migfer@mit.edu
diff --git a/databases/cstore/patches/patch-src_UnitTests_Queries.cpp b/databases/cstore/patches/patch-src_UnitTests_Queries.cpp
new file mode 100644
index 00000000000..6445e7ae052
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_Queries.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_Queries.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/Queries.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/Queries.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "Queries.h"
++#include <stdlib.h>
+
+ Queries::Queries()
+ {
diff --git a/databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecode.cpp b/databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecode.cpp
new file mode 100644
index 00000000000..006f3c0555a
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecode.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_RLEEncodeDecode.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/RLEEncodeDecode.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/RLEEncodeDecode.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "RLEEncodeDecode.h"
++#include <stdlib.h>
+
+ RLEEncodeDecode::RLEEncodeDecode()
+ {}
diff --git a/databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecodeII.cpp b/databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecodeII.cpp
new file mode 100644
index 00000000000..f1190b37218
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_RLEEncodeDecodeII.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_RLEEncodeDecodeII.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/RLEEncodeDecodeII.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/RLEEncodeDecodeII.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "RLEEncodeDecodeII.h"
++#include <stdlib.h>
+
+ RLEEncodeDecodeII::RLEEncodeDecodeII()
+ {}
diff --git a/databases/cstore/patches/patch-src_UnitTests_Type2WriterTest.cpp b/databases/cstore/patches/patch-src_UnitTests_Type2WriterTest.cpp
new file mode 100644
index 00000000000..85d5156a74a
--- /dev/null
+++ b/databases/cstore/patches/patch-src_UnitTests_Type2WriterTest.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_UnitTests_Type2WriterTest.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/UnitTests/Type2WriterTest.cpp.orig 2006-10-17 19:35:33.000000000 +0000
++++ src/UnitTests/Type2WriterTest.cpp
+@@ -29,6 +29,7 @@
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ #include "Type2WriterTest.h"
++#include <stdlib.h>
+
+ Type2WriterTest::Type2WriterTest()
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_Encoder_BitSparseEncoder.cpp b/databases/cstore/patches/patch-src_Wrappers_Encoder_BitSparseEncoder.cpp
new file mode 100644
index 00000000000..890332ec7e1
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_Encoder_BitSparseEncoder.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_Wrappers_Encoder_BitSparseEncoder.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/Encoder/BitSparseEncoder.cpp.orig 2006-09-07 23:39:00.000000000 +0000
++++ src/Wrappers/Encoder/BitSparseEncoder.cpp
+@@ -31,6 +31,7 @@
+ // Encodes Sparse Pages
+
+ #include "BitSparseEncoder.h"
++#include <stdlib.h>
+
+ BitSparseEncoder::BitSparseEncoder(Operator* dataSrc_, int colIndex_, int fieldSize, int bfrSizeInBits_) : Encoder(dataSrc_, colIndex_)
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_Encoder_LZEncoder.cpp b/databases/cstore/patches/patch-src_Wrappers_Encoder_LZEncoder.cpp
new file mode 100644
index 00000000000..5fcb3fb2c72
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_Encoder_LZEncoder.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_Wrappers_Encoder_LZEncoder.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/Encoder/LZEncoder.cpp.orig 2006-08-20 20:41:04.000000000 +0000
++++ src/Wrappers/Encoder/LZEncoder.cpp
+@@ -32,6 +32,7 @@
+ // Problems: dna@mit.edu
+
+ #include "LZEncoder.h"
++#include <stdlib.h>
+
+ LZEncoder::LZEncoder(Operator* dataSrc_, int colIndex_, int numIntsPerPage_) : Encoder(dataSrc_, colIndex_)
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_Encoder_RangeSparseEncoder.cpp b/databases/cstore/patches/patch-src_Wrappers_Encoder_RangeSparseEncoder.cpp
new file mode 100644
index 00000000000..6468a3092fe
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_Encoder_RangeSparseEncoder.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_Wrappers_Encoder_RangeSparseEncoder.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/Encoder/RangeSparseEncoder.cpp.orig 2006-09-07 23:39:00.000000000 +0000
++++ src/Wrappers/Encoder/RangeSparseEncoder.cpp
+@@ -31,6 +31,7 @@
+ // Encodes Sparse Pages
+
+ #include "RangeSparseEncoder.h"
++#include <stdlib.h>
+
+ RangeSparseEncoder::RangeSparseEncoder(Operator* dataSrc_, int colIndex_, int fieldSize, int bfrSizeInBits_) : Encoder(dataSrc_, colIndex_)
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_Encoder_SparseEncoder.cpp b/databases/cstore/patches/patch-src_Wrappers_Encoder_SparseEncoder.cpp
new file mode 100644
index 00000000000..e480c95fc85
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_Encoder_SparseEncoder.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_Wrappers_Encoder_SparseEncoder.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/Encoder/SparseEncoder.cpp.orig 2006-09-07 23:39:00.000000000 +0000
++++ src/Wrappers/Encoder/SparseEncoder.cpp
+@@ -31,6 +31,7 @@
+ // Encodes Sparse Pages
+
+ #include "SparseEncoder.h"
++#include <stdlib.h>
+
+ SparseEncoder::SparseEncoder(Operator* dataSrc_, int colIndex_, int fieldSize, int bfrSizeInBits_) : Encoder(dataSrc_, colIndex_)
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_MultiBlock.h b/databases/cstore/patches/patch-src_Wrappers_MultiBlock.h
new file mode 100644
index 00000000000..b45312bca6c
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_MultiBlock.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Wrappers_MultiBlock.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/MultiBlock.h.orig 2006-08-22 22:29:07.000000000 +0000
++++ src/Wrappers/MultiBlock.h
+@@ -36,7 +36,7 @@
+ #include "../common/Block.h"
+ #include "Type2Block.h"
+ #include "CodingException.h"
+-#include <iostream.h>
++#include <iostream>
+
+ class MultiBlock : public Block
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_PosArrayBlock.h b/databases/cstore/patches/patch-src_Wrappers_PosArrayBlock.h
new file mode 100644
index 00000000000..5225ff9b006
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_PosArrayBlock.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Wrappers_PosArrayBlock.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/PosArrayBlock.h.orig 2006-09-19 21:47:50.000000000 +0000
++++ src/Wrappers/PosArrayBlock.h
+@@ -4,7 +4,7 @@
+ #include "../common/PosBlock.h"
+ #include "../common/UnexpectedException.h"
+ #include "../common/UnimplementedException.h"
+-#include <iostream.h>
++#include <iostream>
+
+ class PosArrayBlock : public PosBlock
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_PosBasicBlock.h b/databases/cstore/patches/patch-src_Wrappers_PosBasicBlock.h
new file mode 100644
index 00000000000..036e5ef779f
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_PosBasicBlock.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_Wrappers_PosBasicBlock.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/PosBasicBlock.h.orig 2006-08-20 20:41:04.000000000 +0000
++++ src/Wrappers/PosBasicBlock.h
+@@ -33,7 +33,8 @@
+
+ #include "../common/PosBlock.h"
+ #include "BasicBlock.h"
+-#include <iostream.h>
++#include <iostream>
++using namespace std;
+ #include "../common/UnexpectedException.h"
+ class PosBasicBlock : public PosBlock
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_SMultiBlock.h b/databases/cstore/patches/patch-src_Wrappers_SMultiBlock.h
new file mode 100644
index 00000000000..9c0dd832aa5
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_SMultiBlock.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Wrappers_SMultiBlock.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/SMultiBlock.h.orig 2006-03-12 22:03:51.000000000 +0000
++++ src/Wrappers/SMultiBlock.h
+@@ -36,7 +36,7 @@
+ #include "../common/Block.h"
+ #include "../common/SBlock.h"
+ #include <string.h>
+-#include <iostream.h>
++#include <iostream>
+
+ class SMultiBlock : public SBlock
+ {
diff --git a/databases/cstore/patches/patch-src_Wrappers_SparseBlock.h b/databases/cstore/patches/patch-src_Wrappers_SparseBlock.h
new file mode 100644
index 00000000000..9c9ba963684
--- /dev/null
+++ b/databases/cstore/patches/patch-src_Wrappers_SparseBlock.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_Wrappers_SparseBlock.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/Wrappers/SparseBlock.h.orig 2006-09-07 23:39:00.000000000 +0000
++++ src/Wrappers/SparseBlock.h
+@@ -37,7 +37,7 @@
+ #include "Type2Block.h"
+ #include "../common/PosBlock.h"
+ #include "CodingException.h"
+-#include <iostream.h>
++#include <iostream>
+
+ class SparseBlock : public MultiBlock
+ {
diff --git a/databases/cstore/patches/patch-src_common_BlockWithPos.h b/databases/cstore/patches/patch-src_common_BlockWithPos.h
new file mode 100644
index 00000000000..90014df5e2a
--- /dev/null
+++ b/databases/cstore/patches/patch-src_common_BlockWithPos.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_common_BlockWithPos.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/common/BlockWithPos.h.orig 2006-08-20 20:41:49.000000000 +0000
++++ src/common/BlockWithPos.h
+@@ -36,7 +36,8 @@
+
+ #include "BlockPosNonContig.h"
+ #include "PosBlock.h"
+-#include <iostream.h>
++#include <iostream>
++using namespace std;
+
+ class BlockWithPos : public BlockPosNonContig
+ {
diff --git a/databases/cstore/patches/patch-src_common_MinicolBlock.h b/databases/cstore/patches/patch-src_common_MinicolBlock.h
new file mode 100644
index 00000000000..4cfbc64c212
--- /dev/null
+++ b/databases/cstore/patches/patch-src_common_MinicolBlock.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_common_MinicolBlock.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/common/MinicolBlock.h.orig 2006-04-05 16:33:35.000000000 +0000
++++ src/common/MinicolBlock.h
+@@ -5,7 +5,7 @@
+ #include "PosBlock.h"
+ #include "Constants.h" // for PAGE_SIZE
+ #include "BlockWithPos.h"
+-#include <list.h>
++#include <list>
+ #include "../Operators/MinicolShimOperator.h"
+
+ /** An class representing a series of positions and corresponding values from one or
diff --git a/databases/cstore/patches/patch-src_common_PosBlockArray.h b/databases/cstore/patches/patch-src_common_PosBlockArray.h
new file mode 100644
index 00000000000..ee377ec22a8
--- /dev/null
+++ b/databases/cstore/patches/patch-src_common_PosBlockArray.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_common_PosBlockArray.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/common/PosBlockArray.h.orig 2006-02-24 06:06:35.000000000 +0000
++++ src/common/PosBlockArray.h
+@@ -33,7 +33,7 @@
+
+ #include "PosBlock.h"
+ #include "../Wrappers/CodingException.h"
+-#include <iostream.h>
++#include <iostream>
+
+ // Array of Position Blocks
+ class PosBlockArray : public PosBlock
diff --git a/databases/cstore/patches/patch-src_compressionexps_Dict2DataMaker.h b/databases/cstore/patches/patch-src_compressionexps_Dict2DataMaker.h
new file mode 100644
index 00000000000..93efc11984b
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_Dict2DataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_Dict2DataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/Dict2DataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/Dict2DataMaker.h
+@@ -60,7 +60,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class Dict2DataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_DictCPU2DataMaker.h b/databases/cstore/patches/patch-src_compressionexps_DictCPU2DataMaker.h
new file mode 100644
index 00000000000..1e3fd26fe25
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_DictCPU2DataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_DictCPU2DataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/DictCPU2DataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/DictCPU2DataMaker.h
+@@ -60,7 +60,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class DictCPU2DataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_Int2DataMaker.h b/databases/cstore/patches/patch-src_compressionexps_Int2DataMaker.h
new file mode 100644
index 00000000000..bc21b8fdac0
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_Int2DataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_Int2DataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/Int2DataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/Int2DataMaker.h
+@@ -57,7 +57,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class Int2DataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_JoinExpDataMaker.h b/databases/cstore/patches/patch-src_compressionexps_JoinExpDataMaker.h
new file mode 100644
index 00000000000..4f653b14646
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_JoinExpDataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_JoinExpDataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/JoinExpDataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/JoinExpDataMaker.h
+@@ -61,7 +61,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class JoinExpDataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.cpp b/databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.cpp
new file mode 100644
index 00000000000..69ddce33312
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_LZ2DataMaker.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/LZ2DataMaker.cpp.orig 2006-10-18 06:04:07.000000000 +0000
++++ src/compressionexps/LZ2DataMaker.cpp
+@@ -31,7 +31,7 @@
+ /**
+ */
+ #include "LZ2DataMaker.h"
+-#include <fstream.h>
++#include <fstream>
+
+ LZ2DataMaker::LZ2DataMaker() {
+ }
diff --git a/databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.h b/databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.h
new file mode 100644
index 00000000000..b55fbf78a86
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_LZ2DataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_LZ2DataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/LZ2DataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/LZ2DataMaker.h
+@@ -57,7 +57,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class LZ2DataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_LZDataMaker.cpp b/databases/cstore/patches/patch-src_compressionexps_LZDataMaker.cpp
new file mode 100644
index 00000000000..70c3970ea4f
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_LZDataMaker.cpp
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_LZDataMaker.cpp,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/LZDataMaker.cpp.orig 2006-10-18 06:04:07.000000000 +0000
++++ src/compressionexps/LZDataMaker.cpp
+@@ -31,7 +31,7 @@
+ /**
+ */
+ #include "LZDataMaker.h"
+-#include <fstream.h>
++#include <fstream>
+
+ LZDataMaker::LZDataMaker() {
+ }
diff --git a/databases/cstore/patches/patch-src_compressionexps_NS2DataMaker.h b/databases/cstore/patches/patch-src_compressionexps_NS2DataMaker.h
new file mode 100644
index 00000000000..960febd40cb
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_NS2DataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_NS2DataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/NS2DataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/NS2DataMaker.h
+@@ -57,7 +57,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class NS2DataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_RLE2DataMaker.h b/databases/cstore/patches/patch-src_compressionexps_RLE2DataMaker.h
new file mode 100644
index 00000000000..38f50f32022
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_RLE2DataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_RLE2DataMaker.h,v 1.1 2011/12/20 13:42:47 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/RLE2DataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/RLE2DataMaker.h
+@@ -55,7 +55,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class RLE2DataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_compressionexps_SelExpDataMaker.h b/databases/cstore/patches/patch-src_compressionexps_SelExpDataMaker.h
new file mode 100644
index 00000000000..ee953672f3a
--- /dev/null
+++ b/databases/cstore/patches/patch-src_compressionexps_SelExpDataMaker.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_compressionexps_SelExpDataMaker.h,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/compressionexps/SelExpDataMaker.h.orig 2006-10-17 19:36:03.000000000 +0000
++++ src/compressionexps/SelExpDataMaker.h
+@@ -61,7 +61,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class SelExpDataMaker : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_materialexps_PosAndEM.cpp b/databases/cstore/patches/patch-src_materialexps_PosAndEM.cpp
new file mode 100644
index 00000000000..691f14dd8c3
--- /dev/null
+++ b/databases/cstore/patches/patch-src_materialexps_PosAndEM.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_materialexps_PosAndEM.cpp,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/materialexps/PosAndEM.cpp.orig 2006-05-25 20:23:51.000000000 +0000
++++ src/materialexps/PosAndEM.cpp
+@@ -32,6 +32,7 @@
+ */
+ #include "PosAndEM.h"
+ #include "posand-support.h"
++#include <stdlib.h>
+
+ PosAndEM::PosAndEM() {
+ }
diff --git a/databases/cstore/patches/patch-src_materialexps_PosAndLM.cpp b/databases/cstore/patches/patch-src_materialexps_PosAndLM.cpp
new file mode 100644
index 00000000000..b438b127854
--- /dev/null
+++ b/databases/cstore/patches/patch-src_materialexps_PosAndLM.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_materialexps_PosAndLM.cpp,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/materialexps/PosAndLM.cpp.orig 2006-05-24 22:00:22.000000000 +0000
++++ src/materialexps/PosAndLM.cpp
+@@ -31,6 +31,7 @@
+ /**
+ */
+ #include "PosAndLM.h"
++#include <stdlib.h>
+
+ PosAndLM::PosAndLM() {
+ }
diff --git a/databases/cstore/patches/patch-src_materialexps_PosAndMC.cpp b/databases/cstore/patches/patch-src_materialexps_PosAndMC.cpp
new file mode 100644
index 00000000000..501af80fc54
--- /dev/null
+++ b/databases/cstore/patches/patch-src_materialexps_PosAndMC.cpp
@@ -0,0 +1,12 @@
+$NetBSD: patch-src_materialexps_PosAndMC.cpp,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/materialexps/PosAndMC.cpp.orig 2006-05-31 05:17:53.000000000 +0000
++++ src/materialexps/PosAndMC.cpp
+@@ -1,4 +1,5 @@
+ #include "PosAndMC.h"
++#include <stdlib.h>
+
+ PosAndMC::PosAndMC()
+ {
diff --git a/databases/cstore/patches/patch-src_plan_Node.h b/databases/cstore/patches/patch-src_plan_Node.h
new file mode 100644
index 00000000000..dd5eef2e3bf
--- /dev/null
+++ b/databases/cstore/patches/patch-src_plan_Node.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_plan_Node.h,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/plan/Node.h.orig 2006-09-29 20:45:18.000000000 +0000
++++ src/plan/Node.h
+@@ -41,7 +41,7 @@
+ #ifndef _NODE_H_
+ #define _NODE_H_
+
+-#include <fstream.h>
++#include <fstream>
+ #include <iostream>
+ #include <list>
+ #include <string>
diff --git a/databases/cstore/patches/patch-src_plan_Nodes_SelectNode.cpp b/databases/cstore/patches/patch-src_plan_Nodes_SelectNode.cpp
new file mode 100644
index 00000000000..fbe18b570e1
--- /dev/null
+++ b/databases/cstore/patches/patch-src_plan_Nodes_SelectNode.cpp
@@ -0,0 +1,14 @@
+$NetBSD: patch-src_plan_Nodes_SelectNode.cpp,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/plan/Nodes/SelectNode.cpp.orig 2006-09-29 20:45:18.000000000 +0000
++++ src/plan/Nodes/SelectNode.cpp
+@@ -45,6 +45,7 @@
+ #include "../../AM/CatalogInstance.h"
+ #include "../../Operators/Union.h"
+ #include <iostream>
++#include <stdlib.h>
+
+
+ // Default
diff --git a/databases/cstore/patches/patch-src_sparseexps_SelExpDM.h b/databases/cstore/patches/patch-src_sparseexps_SelExpDM.h
new file mode 100644
index 00000000000..d369a440e84
--- /dev/null
+++ b/databases/cstore/patches/patch-src_sparseexps_SelExpDM.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_sparseexps_SelExpDM.h,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/sparseexps/SelExpDM.h.orig 2006-10-17 19:36:12.000000000 +0000
++++ src/sparseexps/SelExpDM.h
+@@ -67,7 +67,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class SelExpDM : public UnitTest
+ {
diff --git a/databases/cstore/patches/patch-src_sparseexps_StrSelExpDM.h b/databases/cstore/patches/patch-src_sparseexps_StrSelExpDM.h
new file mode 100644
index 00000000000..2a8090b8450
--- /dev/null
+++ b/databases/cstore/patches/patch-src_sparseexps_StrSelExpDM.h
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_sparseexps_StrSelExpDM.h,v 1.1 2011/12/20 13:42:48 wiz Exp $
+
+Add missing header.
+
+--- src/sparseexps/StrSelExpDM.h.orig 2006-10-17 19:36:12.000000000 +0000
++++ src/sparseexps/StrSelExpDM.h
+@@ -51,7 +51,7 @@
+ #include "../AM/PagePlacer.h"
+ #include <ctime>
+ #include "../UnitTests/UnitTest.h"
+-#include <fstream.h>
++#include <fstream>
+
+ class StrSelExpDM : public UnitTest
+ {