1 /*
2  * Copyright (c) 2016 Wind River Systems, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /*
8  * @file
9  * @brief Basic C++ destructor module for globals
10  *
11  */
12 
13 #include <zephyr/toolchain.h>
14 
15 __weak void *__dso_handle;
16 
17 #if !defined(CONFIG_ARCH_POSIX)
18 /*
19  * For the POSIX architecture we do not define an empty __cxa_atexit() as it otherwise
20  * would override its host libC counterpart. And this would both disable the atexit()
21  * hooks, and prevent possible test code global destructors from being registered.
22  */
23 
24 /**
25  * @brief Register destructor for a global object
26  *
27  * @param destructor the global object destructor function
28  * @param objptr global object pointer
29  * @param dso Dynamic Shared Object handle for shared libraries
30  *
31  * Function does nothing at the moment, assuming the global objects
32  * do not need to be deleted
33  *
34  * @retval 0 on success.
35  */
__cxa_atexit(void (* destructor)(void *),void * objptr,void * dso)36 int __cxa_atexit(void (*destructor)(void *), void *objptr, void *dso)
37 {
38 	ARG_UNUSED(destructor);
39 	ARG_UNUSED(objptr);
40 	ARG_UNUSED(dso);
41 	return 0;
42 }
43 #endif
44