cplusglob.cpp

来自「vxworks源码源码解读是学习vxworks的最佳途径」· C++ 代码 · 共 74 行

CPP
74
字号
/* cplusGlob.cpp - support for calling all linked C++ static ctors/dtors *//* Copyright 1993 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01f,17mar99,sn   made ctorsInitialized global and changed its name to                 linkedCtorsInitialized01e,17oct96,bjl  modified cplusCtorsLink to do nothing if it has already 		 been called01d,10oct94,srh  fixed interface between cplus[CD]torsLink and_[cd]tors arrays01c,18jun93,jdi  more doc cleanup.01b,03jun93,srh  doc cleanup01a,25apr93,srh  written*//** DESCRIPTION* This module provides interfaces to cplusCallCtors and cplusCallDtors* for C++ modules that are linked with VxWorks. These functions should* be called from usrRoot.** NOMANUAL*/#include "vxWorks.h"#include "cplusLib.h"extern VOIDFUNCPTR _ctors[];extern VOIDFUNCPTR _dtors[];/******************************************************************************** cplusCtorsLink - call all linked static constructors (C++)** This function calls constructors for all of the static objects linked* with a VxWorks bootable image.  When creating bootable applications,* this function should be called from usrRoot() to initialize all static* objects.  Correct operation depends on correctly munching the C++* modules that are linked with VxWorks.** RETURNS: N/A*/BOOL linkedCtorsInitialized = FALSE;extern "C" void cplusCtorsLink ()    {    if (!linkedCtorsInitialized)       {       cplusCallCtors (_ctors);       linkedCtorsInitialized = TRUE;       }    }/******************************************************************************** cplusDtorsLink - call all linked static destructors (C++)** This function calls destructors for all of the static objects linked* with a VxWorks bootable image.  When creating bootable applications,* this function should be called during system shutdown to decommission* all static objects.  Correct operation depends on correctly munching* the C++ modules that are linked with VxWorks.** RETURNS: N/A*/extern "C" void cplusDtorsLink ()    {    cplusCallDtors (_dtors);    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?