Skip to content

Commit

Permalink
fix compile error occurring with non-c++11 compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jul 21, 2013
1 parent 942ce10 commit 3df0dd0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/shogun/lib/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max-Planck-Society
*/

#include <shogun/lib/config.h>
#include <shogun/lib/ShogunException.h>
#include <shogun/lib/common.h>
#include <shogun/lib/Map.h>
Expand Down Expand Up @@ -80,7 +81,11 @@ void MemoryBlock::set_sgobject()
}
#endif

#ifdef HAVE_CXX11
void* operator new(size_t size)
#else
void* operator new(size_t size) throw (std::bad_alloc)
#endif
{
void *p=malloc(size);
#ifdef TRACE_MEMORY_ALLOCS
Expand Down Expand Up @@ -111,7 +116,11 @@ void operator delete(void *p) throw()
free(p);
}

#ifdef HAVE_CXX11
void* operator new[](size_t size)
#else
void* operator new[](size_t size) throw(std::bad_alloc)
#endif
{
void *p=malloc(size);
#ifdef TRACE_MEMORY_ALLOCS
Expand Down

0 comments on commit 3df0dd0

Please sign in to comment.