mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
fix build on ghc4.8 (issue #330)
This commit is contained in:
parent
d1d06b67eb
commit
745cf1e2f5
1 changed files with 6 additions and 1 deletions
|
@ -778,7 +778,12 @@ but we call `exit` instead (i.e. not returning).
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <new>
|
#include <new>
|
||||||
static bool mi_try_new_handler(bool nothrow) {
|
static bool mi_try_new_handler(bool nothrow) {
|
||||||
std::new_handler h = std::get_new_handler();
|
#if defined(_MSC_VER) || (__cplusplus >= 201103L)
|
||||||
|
std::new_handler h = std::get_new_handler();
|
||||||
|
#else
|
||||||
|
std::new_handler h = std::set_new_handler();
|
||||||
|
std::set_new_handler(h);
|
||||||
|
#endif
|
||||||
if (h==NULL) {
|
if (h==NULL) {
|
||||||
if (!nothrow) throw std::bad_alloc();
|
if (!nothrow) throw std::bad_alloc();
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue