]> granicus.if.org Git - gc/commitdiff
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 83e0a2c3379238)

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 8718f5a17d5237a560b65c0e778f8c88717810d8..6f25e336b0504b88d624d3a771922d5c8600c5bf 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 9110633fc166543f7b3092e2eaf9e3526cd68083..ea0e9705aa621f7290ae6f652c6abd3638f8c64e 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 */