summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/nix-flake.yml2
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/utils.cc38
3 files changed, 6 insertions, 36 deletions
diff --git a/.github/workflows/nix-flake.yml b/.github/workflows/nix-flake.yml
index 78296fe9..d95ba79f 100644
--- a/.github/workflows/nix-flake.yml
+++ b/.github/workflows/nix-flake.yml
@@ -13,7 +13,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
steps:
- - uses: cachix/install-nix-action@V27
+ - uses: cachix/install-nix-action@V28
with:
nix_path: nixpkgs=channel:nixos-unstable
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa8594e4..2b2cca92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,7 +21,7 @@ set(Ledger_TEST_TIMEZONE "America/Chicago")
enable_testing()
add_compile_definitions(BOOST_FILESYSTEM_NO_DEPRECATED)
-add_compile_options(-std=c++11)
+set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard")
if (CYGWIN)
add_compile_options(-U__STRICT_ANSI__)
endif()
diff --git a/src/utils.cc b/src/utils.cc
index 1cc19ca0..0eb81220 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -229,54 +229,24 @@ 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 * operator new(std::size_t size) {
void * ptr = std::malloc(size);
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_new_func(ptr, "new", size);
return ptr;
}
-void * operator new(std::size_t size, const std::nothrow_t&) throw() {
- void * ptr = std::malloc(size);
- if (DO_VERIFY() && ledger::memory_tracing_active)
- 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);
- return ptr;
-}
-void * operator new[](std::size_t size, const std::nothrow_t&) throw() {
+void * operator new[](std::size_t size) {
void * ptr = std::malloc(size);
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_new_func(ptr, "new[]", size);
return ptr;
}
-void operator delete(void * ptr) throw() {
+void operator delete(void * ptr) {
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_delete_func(ptr, "new");
std::free(ptr);
}
-void operator delete(void * ptr, const std::nothrow_t&) throw() {
- if (DO_VERIFY() && ledger::memory_tracing_active)
- ledger::trace_delete_func(ptr, "new");
- std::free(ptr);
-}
-void operator delete[](void * ptr) throw() {
- if (DO_VERIFY() && ledger::memory_tracing_active)
- ledger::trace_delete_func(ptr, "new[]");
- std::free(ptr);
-}
-void operator delete[](void * ptr, const std::nothrow_t&) throw() {
+void operator delete[](void * ptr) {
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_delete_func(ptr, "new[]");
std::free(ptr);