xref: /netbsd-src/external/bsd/libc++/dist/libcxxrt/src/cxa_finalize.c (revision ccec91a1a97277b5fa1e64b269648792fb078e34)
1*ccec91a1Sjoerg /**
2*ccec91a1Sjoerg  * Copyright (c) 2012 David Chisnall.
3*ccec91a1Sjoerg  *
4*ccec91a1Sjoerg  * Permission is hereby granted, free of charge, to any person obtaining a copy
5*ccec91a1Sjoerg  * of this software and associated documentation files (the "Software"), to
6*ccec91a1Sjoerg  * deal in the Software without restriction, including without limitation the
7*ccec91a1Sjoerg  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8*ccec91a1Sjoerg  * sell copies of the Software, and to permit persons to whom the Software is
9*ccec91a1Sjoerg  * furnished to do so, subject to the following conditions:
10*ccec91a1Sjoerg  *
11*ccec91a1Sjoerg  * The above copyright notice and this permission notice shall be included in
12*ccec91a1Sjoerg  * all copies or substantial portions of the Software.
13*ccec91a1Sjoerg  *
14*ccec91a1Sjoerg  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*ccec91a1Sjoerg  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*ccec91a1Sjoerg  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17*ccec91a1Sjoerg  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18*ccec91a1Sjoerg  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19*ccec91a1Sjoerg  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20*ccec91a1Sjoerg  * IN THE SOFTWARE.
21*ccec91a1Sjoerg  *
22*ccec91a1Sjoerg  */
23*ccec91a1Sjoerg 
24*ccec91a1Sjoerg 
25*ccec91a1Sjoerg void __cxa_finalize(void *d );
26*ccec91a1Sjoerg 
27*ccec91a1Sjoerg extern void *__dso_handle;
28*ccec91a1Sjoerg 
29*ccec91a1Sjoerg __attribute__((__destructor__, __used__))
cleanup(void)30*ccec91a1Sjoerg static void cleanup(void) {
31*ccec91a1Sjoerg   __cxa_finalize(&__dso_handle);
32*ccec91a1Sjoerg }
33