📄 cplusinit.cpp
字号:
/* cplusInit.C - initialize run-time support for C++ *//* Copyright 1993 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02e,11oct98,ms reworked 02d fix, since it was causing bootrom builds to fail02d,08oct98,sn moved defn of cplusXtorStrategy from cplusUsr.cpp to here02c,17sep98,ms removed force-links of loader support modules02b,16jan98,sn add force-link of 'new-style' new/delete02a,15jan98,sn add force-link of exception handling/RTTI01f,20jun95,srh remove force-link of iostreams.01e,18jun95,srh change cplusCfront to cplusCore.01d,18jun93,jdi more doc cleanup.01c,03jun93,srh doc cleanup01b,23apr93,srh implemented new force-link/initialization scheme01a,23apr93,srh written.*//*DESCRIPTIONThis module defines cplusLibInit, and implements a scheme that forcesmost of the WindC++ run-time support to be linked with VxWorks.Initialization is actually performed by cplusLibMinInit(), which isdefined elsewhere.NOMANUAL*//* Includes */#include "vxWorks.h"#include "cplusLib.h"#include "cplusEhInit.cpp"#include "cplusNewInit.cpp"/* Defines *//* Globals *//* * This is used by the target loader if there is one: more * importantly the host tools become C++ enabled if and * only if this symbol is defined. *//*CPLUS_XTOR_STRATEGIES cplusXtorStrategy = AUTOMATIC;*//* Locals */extern char __cplusCore_o;extern char __cplusStr_o;extern char __cplusXtors_o;extern char __cplusUsr_o;static char * cplusObjFiles [30] = { & __cplusCore_o, & __cplusStr_o, & __cplusXtors_o, & __cplusUsr_o, };/* Forward declarations *//********************************************************************************* cplusLibInit - initialize the C++ library (C++)** This routine initializes the C++ library and forces all C++ run-time support* to be linked with the bootable VxWorks image. If INCLUDE_CPLUS is defined* in configAll.h, cplusLibInit() is called automatically from the root task,* usrRoot(), in usrConfig.c.** RETURNS: OK or ERROR.*/extern void cplusTerminate ();extern void (*set_terminate (void (*)())) ();extern "C" STATUS cplusLibInit (void) {/* We do this here to avoid pulling in exception handling code with * INCLUDE_CPLUS_MIN */ set_terminate (cplusTerminate); return cplusLibMinInit (); }/********************************************************************************* __cplusForce - Force linking of C++ library** This routine defines an external function that should never be called.* Its purpose is to forge a reference to the arrays# cplusObjFiles, cplusEhObjs and cplusNewObjs that* even smart compilers like Green Hills' won't optimize away (GHS optimizes* away the unreferenced static data).** NOMANUAL** RETURNS: Never called*/extern "C" void __pure_virtual_called (...);extern "C" void__cplusForce (void) { __pure_virtual_called (cplusObjFiles[0]); __pure_virtual_called (cplusEhObjs[0]); __pure_virtual_called (cplusNewObjs[0]); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -