cplusxtors.cpp
来自「vxworks源码源码解读是学习vxworks的最佳途径」· C++ 代码 · 共 89 行
CPP
89 行
/* cplusXtors.cpp - run time support for static ctors and dtors *//* Copyright 1993 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01c,03jun93,srh doc cleanup01b,23apr93,srh implemented new force-link/initialization scheme01a,31jan93,srh written.*//*DESCRIPTIONThis module contains core run time support for static constructors anddestructors. It contains no user-callable routines.NOMANUAL*//* Includes */#include "vxWorks.h"#include "cplusLib.h"/* Defines *//* Typedefs *//* Globals */char __cplusXtors_o;/* Locals *//* Forward declarations *//******************************************************************************** cplusCallCtors - call static constructors** This routine takes a <ctors> array, as generated by the munch utility,* and calls the function which is pointed to by each entry. Each function* in the <ctors> array calls the static constructors for one compilation* unit. The functions are called in the first-to-last order.** NOMANUAL*/void cplusCallCtors ( VOIDFUNCPTR *ctors // array of pointers to ctor-calling functions ) { // call ctors in order for (VOIDFUNCPTR *pVFP = ctors; *pVFP != 0; pVFP++) { (**pVFP)(); } }/******************************************************************************** cplusCallDtors - call static destructors** This routine takes a <dtors> array, as generated by the munch utility,* and calls the function which is pointed to by each entry. Each function* in the <dtors> array calls the static destructors for one compilation* unit. The functions are called in the last-to-first order, reversing* the order in which the static constructors were originally called.** NOMANUAL*/void cplusCallDtors ( VOIDFUNCPTR *dtors // array of pointers to dtor-calling functions ) { // advance pVFP to end of dtors list for (VOIDFUNCPTR *pVFP = dtors; *pVFP != 0; pVFP++) { } // call dtors in reverse order of ctors while (pVFP > dtors) { (**--pVFP)(); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?