Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 279e911

Browse files
authored
Merge pull request #4 from labodj/c++17-fix
Fix build for c++17, exception specifications are not allowed anymore.
2 parents cad5581 + 84a9878 commit 279e911

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/new

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,21 @@ namespace std{
3636
_UCXXEXPORT new_handler set_new_handler(new_handler new_p) throw();
3737
}
3838

39-
40-
_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc);
39+
#if (__cplusplus < 201703L)
40+
_UCXXEXPORT void* operator new(std::size_t numBytes) throw(std::bad_alloc);
41+
#else
42+
_UCXXEXPORT void* operator new(std::size_t numBytes) noexcept(false);
43+
#endif
4144
_UCXXEXPORT void operator delete(void* ptr) throw();
4245
#if __cpp_sized_deallocation
4346
_UCXXEXPORT void operator delete(void* ptr, std::size_t) throw();
4447
#endif
4548

46-
_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc);
49+
#if (__cplusplus < 201703L)
50+
_UCXXEXPORT void* operator new[](std::size_t numBytes) throw(std::bad_alloc);
51+
#else
52+
_UCXXEXPORT void* operator new[](std::size_t numBytes) noexcept(false);
53+
#endif
4754
_UCXXEXPORT void operator delete[](void * ptr) throw();
4855
#if __cpp_sized_deallocation
4956
_UCXXEXPORT void operator delete[](void * ptr, std::size_t) throw();

0 commit comments

Comments
 (0)