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