vxwerr.cpp
来自「vxworks源码源码解读是学习vxworks的最佳途径」· C++ 代码 · 共 77 行
CPP
77 行
// vxwErr.cpp - error handling class// Copyright 1995-1999 Wind River Systems, Inc.#include "copyright_wrs.h"//// modification history// --------------------// 01b,23feb99,fle doc : made it refgen compliant// 01a,15jun95,srh written.//// IMPLEMENTS ../../../h/vxwErr.h #include "vxWorks.h"#include "cplusLib.h"#include "stdio.h"#include "string.h"#include "taskLib.h"#include "vxwErr.h"static voidvxwDefaultErrRoutine (const VXWError &error) { cplusLogMsg ("%s\n", int (error.why ()), 0, 0, 0, 0, 0); taskSuspend (0); }static void (*vxwErrRoutine) (const VXWError &) = vxwDefaultErrRoutine;voidvxwSetErrHandler (void (*newErrHandler) (const VXWError &)) { vxwErrRoutine = newErrHandler; }voidvxwThrow (const VXWError &err) { (*vxwErrRoutine) (err); }VXWError::VXWError (const char *str) { makeCopy (str); }VXWError::VXWError (const int err) { char buf [100]; sprintf (buf, "VXW error, errno: 0x%x\n", err); makeCopy (buf); }VXWError::VXWError (const VXWError &err) { makeCopy (err.errorMessage_); }VXWError::~VXWError () { if (errorMessage_ != 0) delete (char *) (errorMessage_); errorMessage_ = 0; }void VXWError::makeCopy (const char *str) { char *p = new char [ strlen (str) + 1 ]; strcpy (p, str); errorMessage_ = p; }char __vxwErr_o; // for forced linking in src/config/cplus*.c
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?