From: Ivan Maidanski Date: Sat, 29 Oct 2016 14:31:41 +0000 (+0300) Subject: Fix 'replacement operator delete cannot be inline' GCC warning (Cygwin) X-Git-Tag: v7.4.6~228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d43cb973b099f391b9e1a1e859fcab04d3d82b8d;p=gc Fix 'replacement operator delete cannot be inline' GCC warning (Cygwin) (Cherry-pick commit 057011d from 'release-7_6' branch.) This commit also eliminates "operator delete is missing exception specification throw()" compiler warning. * gc_cpp.cc (operator delete): Define unconditionally (i.e. for Cygwin too). * include/gc_cpp.h [__CYGWIN__]: Do not include "new" header. * include/gc_cpp.h [__CYGWIN__] (operator delete): Remove (as replacement function 'operator delete' cannot be declared 'inline'). --- diff --git a/gc_cpp.cc b/gc_cpp.cc index 0f6c9d2b..bf880c08 100644 --- a/gc_cpp.cc +++ b/gc_cpp.cc @@ -47,11 +47,9 @@ void* operator new( size_t size ) GC_DECL_NEW_THROW { return GC_MALLOC_UNCOLLECTABLE(size); } -#if !defined(__CYGWIN__) - void operator delete( void* obj ) GC_DECL_DELETE_THROW { + void operator delete(void* obj) GC_DECL_DELETE_THROW { GC_FREE(obj); } -#endif /* !__CYGWIN__ */ #ifdef GC_OPERATOR_NEW_ARRAY void* operator new[]( size_t size ) GC_DECL_NEW_THROW { diff --git a/include/gc_cpp.h b/include/gc_cpp.h index 0302439d..2e4aa1b4 100644 --- a/include/gc_cpp.h +++ b/include/gc_cpp.h @@ -425,12 +425,4 @@ inline void* operator new( size_t size, GC_NS_QUALIFY(GCPlacement) gcp, } #endif /* GC_OPERATOR_NEW_ARRAY */ -#if defined(__CYGWIN__) -# include // for delete throw() - inline void operator delete(void *p) - { - GC_FREE(p); - } -#endif - #endif /* GC_CPP_H */