Fix 'replacement operator delete cannot be inline' GCC warning (Cygwin)
authorIvan Maidanski <ivmai@mail.ru>
Sat, 29 Oct 2016 14:31:41 +0000 (17:31 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 29 Oct 2016 14:31:41 +0000 (17:31 +0300)
(fix commits 83e0a2c, 3379238)

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').

gc_cpp.cc
include/gc_cpp.h

index 8718f5a..6f25e33 100644 (file)
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -49,11 +49,9 @@ built-in "new" and "delete".
     return GC_MALLOC_UNCOLLECTABLE(size);
   }
 
-# if !defined(__CYGWIN__)
-    void operator delete(void* obj) GC_DECL_DELETE_THROW {
-      GC_FREE(obj);
-    }
-# endif // !__CYGWIN__
+  void operator delete(void* obj) GC_DECL_DELETE_THROW {
+    GC_FREE(obj);
+  }
 
 # ifdef GC_OPERATOR_NEW_ARRAY
     void* operator new[](size_t size) GC_DECL_NEW_THROW {
index 9110633..ea0e970 100644 (file)
@@ -487,12 +487,4 @@ inline void* operator new(size_t size, GC_NS_QUALIFY(GCPlacement) gcp,
   }
 #endif // GC_OPERATOR_NEW_ARRAY
 
-#if defined(__CYGWIN__)
-# include <new> // for delete throw()
-  inline void operator delete(void* p)
-  {
-    GC_FREE(p);
-  }
-#endif // __CYGWIN__
-
 #endif /* GC_CPP_H */