Skip to content

Commit

Permalink
reHC*, fix compilation issues with Boost Libraries newer than 1.44 (fix
Browse files Browse the repository at this point in the history
#3).
  • Loading branch information
yp committed Aug 2, 2012
1 parent 4620e1b commit 572f4b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ link_directories(${Log4Cxx_LIBRARY_DIRS})

set (CMAKE_CXX_FLAGS "-std=c++0x -Wall ${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS_DEBUG "-O0 ${CMAKE_CXX_FLAGS_DEBUG}")
set (CMAKE_CXX_FLAGS_RELEASE "-mtune=native -fomit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}")
set (CMAKE_CXX_FLAGS_RELEASE "-march=native -fomit-frame-pointer ${CMAKE_CXX_FLAGS_RELEASE}")

include(ExtractSourceVersionFromGit)
set (APPLICATION_VERSION_STRING "${APPLICATION_SOURCE_VERSION}") # See the version from the 'git' repositories
Expand Down
10 changes: 9 additions & 1 deletion include/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/ptr_container/ptr_list.hpp>

#include <boost/version.hpp>

#include "assertion.hpp"

Expand Down Expand Up @@ -322,7 +322,11 @@ class file_utility:
throw std::logic_error(std::string("Impossible to open a temporary file with hint '")
+ file_template + "' for writing.");
}
#if (BOOST_VERSION >= 104400)
boost::iostreams::file_descriptor_sink sink(fd, boost::iostreams::close_handle);
#else
boost::iostreams::file_descriptor_sink sink(fd);
#endif
if (!sink.is_open()) {
L_ERROR("Impossible to open file '" << real_name << "' for writing.");
throw std::logic_error(std::string("Impossible to open file '")
Expand Down Expand Up @@ -350,7 +354,11 @@ class file_utility:
L_ERROR("Impossible to open a stream associated to the given C-file.");
throw std::logic_error(std::string("Impossible to open a stream associated to the given C-file."));
}
#if (BOOST_VERSION >= 104400)
boost::iostreams::file_descriptor_sink sink(fd, boost::iostreams::close_handle);
#else
boost::iostreams::file_descriptor_sink sink(fd);
#endif
if (!sink.is_open()) {
L_ERROR("Impossible to open the given C-file.");
throw std::logic_error(std::string("Impossible to open the given C-file."));
Expand Down

0 comments on commit 572f4b1

Please sign in to comment.