From 7453997e0e4f7fa169bfc3ada828834f89f5b38a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 4 Dec 2002 20:36:23 +0000 Subject: * cxx.cc: New file. Implement new, new[], delete and delete[] operators and __cxa_pure_virtual if compiled by gcc >=3. * Makefile.in (DLL_OFILES): Add cxx.o. Remove libstdc++.a from cygwin1.dll link step. --- winsup/cygwin/cxx.cc | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 winsup/cygwin/cxx.cc (limited to 'winsup/cygwin/cxx.cc') diff --git a/winsup/cygwin/cxx.cc b/winsup/cygwin/cxx.cc new file mode 100644 index 000000000..b52485a20 --- /dev/null +++ b/winsup/cygwin/cxx.cc @@ -0,0 +1,49 @@ +/* cxx.cc + + Copyright 2002 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#if (__GNUC__ >= 3) + +#include "winsup.h" +#include + +void * +operator new (size_t s) +{ + void *p = malloc (s); + if (p) + memset (p,0,s); + return p; +} + +void +operator delete (void *p) +{ + free (p); +} + +void * +operator new[] (size_t s) +{ + return ::operator new (s); +} + +void +operator delete[] (void *p) +{ + ::operator delete (p); +} + +extern "C" void +__cxa_pure_virtual (void) +{ + api_fatal ("pure virtual method called"); +} + +#endif -- cgit v1.2.3