From 4ade61cf0b1b5911b7804db45fc9767832cfc5d4 Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Wed, 9 Mar 2011 22:52:40 +0100
Subject: [PATCH] fixes to make it compile with boost 1.46

---
 cmake_support/FindBoost.cmake               | 6 +++---
 modules/io/src/mol/entity_io_crd_handler.cc | 4 ++++
 modules/io/src/mol/pdb_writer.cc            | 4 ++++
 modules/io/src/mol/sdf_writer.cc            | 9 +++++++--
 4 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/cmake_support/FindBoost.cmake b/cmake_support/FindBoost.cmake
index 68064ebf3..e784de62f 100644
--- a/cmake_support/FindBoost.cmake
+++ b/cmake_support/FindBoost.cmake
@@ -271,9 +271,9 @@ else(Boost_FIND_VERSION_EXACT)
   # The user has not requested an exact version.  Among known
   # versions, find those that are acceptable to the user request.
   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
-    "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0"
-    "1.37" "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
-    "1.34" "1.33.1" "1.33.0" "1.33")
+    "1.46" "1.45" "1.44" "1.43" "1.42" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0"
+    "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.1" "1.36.0" "1.36" "1.35.1" 
+    "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33")
   set(_boost_TEST_VERSIONS)
   if(Boost_FIND_VERSION)
     set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
diff --git a/modules/io/src/mol/entity_io_crd_handler.cc b/modules/io/src/mol/entity_io_crd_handler.cc
index bee473f9d..eb905dc70 100644
--- a/modules/io/src/mol/entity_io_crd_handler.cc
+++ b/modules/io/src/mol/entity_io_crd_handler.cc
@@ -223,7 +223,11 @@ CRDWriter::CRDWriter(std::ostream& ostream) :
 {}
 
 CRDWriter::CRDWriter(const boost::filesystem::path& filename) :
+#if BOOST_FILESYSTEM_VERSION==3
+  outfile_(filename.filename().string().c_str()), outstream_(outfile_),
+#else
   outfile_(filename.file_string().c_str()), outstream_(outfile_),
+#endif
   atom_count_(0)
 {}
 
diff --git a/modules/io/src/mol/pdb_writer.cc b/modules/io/src/mol/pdb_writer.cc
index 6f180688d..31359bbae 100644
--- a/modules/io/src/mol/pdb_writer.cc
+++ b/modules/io/src/mol/pdb_writer.cc
@@ -329,7 +329,11 @@ PDBWriter::PDBWriter(std::ostream& stream, const IOProfile& profile):
 
 PDBWriter::PDBWriter(const boost::filesystem::path& filename, 
                      const IOProfile& profile):
+#if BOOST_FILESYSTEM_VERSION==3                     
+  outfile_(filename.filename().string().c_str()), outstream_(outfile_), 
+#else
   outfile_(filename.file_string().c_str()), outstream_(outfile_), 
+#endif  
   mol_count_(0), line_(80), multi_model_(false), 
   charmm_style_(profile.dialect=="CHARMM"), is_pqr_(false),
   profile_(profile)
diff --git a/modules/io/src/mol/sdf_writer.cc b/modules/io/src/mol/sdf_writer.cc
index 01b1381b0..5f03e1337 100644
--- a/modules/io/src/mol/sdf_writer.cc
+++ b/modules/io/src/mol/sdf_writer.cc
@@ -95,8 +95,13 @@ SDFWriter::SDFWriter(const String& filename)
   : outfile_(filename.c_str()), ostr_(outfile_), counter_(0) {
 }
 
-SDFWriter::SDFWriter(const boost::filesystem::path& filename)
-  : outfile_(filename.file_string().c_str()), ostr_(outfile_), counter_(0) {
+SDFWriter::SDFWriter(const boost::filesystem::path& filename): 
+#if BOOST_FILESYSTEM_VERSION==3
+  outfile_(filename.filename().string().c_str()), 
+#else
+  outfile_(filename.file_string().c_str()), 
+#endif
+  ostr_(outfile_), counter_(0) {
 }
 
 void SDFWriter::Write(const mol::EntityView& ent) {
-- 
GitLab