Fix build for building with g++ 4.8

This commit is contained in:
John Wiegley 2014-05-07 20:49:45 +00:00
parent 73caafa2c5
commit 1aa0e03a9e
5 changed files with 15 additions and 5 deletions

View file

@ -5,7 +5,7 @@ PROJECT(ledger)
set(Ledger_VERSION_MAJOR 3)
set(Ledger_VERSION_MINOR 0)
set(Ledger_VERSION_PATCH 2)
set(Ledger_VERSION_DATE 20140417)
set(Ledger_VERSION_DATE 20140507)
enable_testing()

6
acprep
View file

@ -875,9 +875,9 @@ class PrepareBuild(CommandLineApp):
if self.options.boost_include:
conf_args.append('-DBOOST_INCLUDEDIR=%s' %
self.options.boost_include)
if self.options.build_dir:
conf_args.append('-DBUILD_DIR=%s' %
self.options.build_dir)
# if self.options.build_dir:
# conf_args.append('-DBUILD_DIR=%s' %
# self.options.build_dir)
if self.prefix_directory():
conf_args.append('-DCMAKE_INSTALL_PREFIX=%s' % self.prefix_directory())

View file

@ -2,7 +2,7 @@
, texinfo, gnused }:
let
rev = "20140417";
rev = "20140507";
in
stdenv.mkDerivation {

View file

@ -167,6 +167,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(BUILD_LIBRARY)
list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
endif()
list(APPEND _args "-std=c++11 ")
list(APPEND _args "-x c++-header " ${_inc})
list(APPEND _args -c ${_header_filename} -o ${_pch_filename})
@ -222,6 +223,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
endif()
list(APPEND _args ${GXX_WARNING_FLAGS})
list(APPEND _args "-std=c++11 ")
list(APPEND _args "-x c++-header " ${_inc})
list(APPEND _args -c ${_header_filename} -o ${_gch_filename})

View file

@ -229,7 +229,11 @@ static void trace_delete_func(void * ptr, const char * which)
//#if !defined(__has_feature) || !__has_feature(address_sanitizer)
#ifdef _GLIBCXX_THROW
void * operator new(std::size_t size) _GLIBCXX_THROW(std::bad_alloc) {
#else
void * operator new(std::size_t size) throw (std::bad_alloc) {
#endif
void * ptr = std::malloc(size);
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_new_func(ptr, "new", size);
@ -241,7 +245,11 @@ void * operator new(std::size_t size, const std::nothrow_t&) throw() {
ledger::trace_new_func(ptr, "new", size);
return ptr;
}
#ifdef _GLIBCXX_THROW
void * operator new[](std::size_t size) _GLIBCXX_THROW(std::bad_alloc) {
#else
void * operator new[](std::size_t size) throw (std::bad_alloc) {
#endif
void * ptr = std::malloc(size);
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_new_func(ptr, "new[]", size);