From fc6a0dc849d07c3aace5e06fa6eee01b45e83d68 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 2 Feb 2010 02:00:01 +0000 Subject: * dcrt0.cc (atexit_lock): Delete. (cygwin_exit): Remove atexit lock. (cygwin_atexit): Ditto. Rename parameter to match newlib. Call __cxa_atexit when invoked by a registered DLL. * dll_init.cc (remove_dll_atexit): Delete. (dll_list::find): New function. (dll_list::detach): Use dll_list::find to find dll associated with return address. Use __cxa_finalize to run atexit functions associated with the dll. (cygwin_detach_dll): Don't assume that HANDLE == void *. * dll_init.h (dll_list::find): Declare. (__cxa_atexit): Ditto. (__cxa_finalize): Ditto. * init.cc (dll_entry): Clarify comment. --- winsup/cygwin/dll_init.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'winsup/cygwin/dll_init.h') diff --git a/winsup/cygwin/dll_init.h b/winsup/cygwin/dll_init.h index 90cfa03e2..b37406e82 100644 --- a/winsup/cygwin/dll_init.h +++ b/winsup/cygwin/dll_init.h @@ -79,6 +79,7 @@ public: int reload_on_fork; dll *operator [] (const PWCHAR name); dll *alloc (HINSTANCE, per_process *, dll_type); + dll *find (void *); void detach (void *); void init (); void load_after_fork (HANDLE); @@ -100,3 +101,8 @@ public: extern dll_list dlls; void dll_global_dtors (); + +/* These probably belong in a newlib header but we can keep them here + for now. */ +extern "C" int __cxa_atexit(void (*)(void*), void*, void*); +extern "C" int __cxa_finalize(void*); -- cgit v1.2.3