]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cxx.cc: New file. Implement new, new[], delete and delete[]
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 4 Dec 2002 20:36:23 +0000 (20:36 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 4 Dec 2002 20:36:23 +0000 (20:36 +0000)
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/ChangeLog
winsup/cygwin/Makefile.in
winsup/cygwin/cxx.cc [new file with mode: 0644]

index bec423b00e55ab3442a8968fa9c2becac6fc2ef3..8fc1548a88fd93a1a7713cd3324acdb356dc37fb 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-26  Thomas Pfaff  <tpfaff@gmx.net>
+
+       * 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.
+
 2002-11-29  Steve Osborn  <bub@io.com>
 
        * fhandler_tty.cc (fhandler_pty_master::accept_input): Move
index fe244e3579a2f842a15754115899ca495daea19f..94dac23f23f69e5dae69f92d68648fb60f79f4a3 100644 (file)
@@ -124,7 +124,7 @@ MALLOC_OFILES=@MALLOC_OFILES@
 DLL_IMPORTS:=$(w32api_lib)/libkernel32.a
 
 # Please maintain this list in sorted order, with maximum files per 80 col line
-DLL_OFILES:=assert.o autoload.o cygheap.o cygserver_client.o \
+DLL_OFILES:=assert.o autoload.o cxx.o cygheap.o cygserver_client.o \
        cygserver_transport.o cygserver_transport_pipes.o \
        cygserver_transport_sockets.o cygthread.o dcrt0.o debug.o \
        delqueue.o dir.o dlfcn.o dll_init.o dtable.o environ.o errno.o \
@@ -263,7 +263,7 @@ maintainer-clean realclean: clean
 new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILES) $(DEF_FILE) $(DLL_IMPORTS) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
        $(CXX) $(CXXFLAGS) -nostdlib -Wl,-T$(firstword $^) -Wl,--out-implib,cygdll.a -shared -o $@ \
        -e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
-       $(MALLOC_OBJ) $(LIBM) -lstdc++ $(LIBC) \
+       $(MALLOC_OBJ) $(LIBM) $(LIBC) \
        -lgcc $(DLL_IMPORTS)
 
 # Rule to build libcygwin.a
diff --git a/winsup/cygwin/cxx.cc b/winsup/cygwin/cxx.cc
new file mode 100644 (file)
index 0000000..b52485a
--- /dev/null
@@ -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 <stdlib.h>
+
+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
This page took 0.038538 seconds and 5 git commands to generate.