Changeset 17446
- Timestamp:
- Apr 12, 2008, 10:18:27 PM (18 years ago)
- Location:
- trunk/psLib/src/sys
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psAbort.c
r11686 r17446 11 11 * @author Joshua Hoblitt, University of Hawaii 12 12 * 13 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $14 * @date $Date: 200 7-02-07 23:52:54$13 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2008-04-13 08:18:27 $ 15 15 * 16 16 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 49 49 abort(); 50 50 } 51 52 void p_psAssert(const char *file, 53 unsigned int lineno, 54 const char *func, 55 const bool value, 56 const char *format, 57 ...) 58 { 59 if (value) return; 60 psErrorStackPrint(stderr, "Aborting. Error stack:"); 61 62 va_list argPtr; // variable list arguement pointer 63 // Get the variable list parameters to pass to logging function 64 va_start(argPtr, format); 65 66 // Call logging function with PS_LOG_ABORT level 67 psLogMsgV("psLib.sys", PS_LOG_ABORT, format, argPtr); 68 69 // Clean up stack after variable arguement has been used 70 va_end(argPtr); 71 72 // Call system abort function to terminate program execution 73 abort(); 74 } -
trunk/psLib/src/sys/psAbort.h
r14452 r17446 10 10 * @author Joshua Hoblitt, University of Hawaii 11 11 * 12 * $Revision: 1.1 5$ $Name: not supported by cvs2svn $13 * $Date: 200 7-08-09 01:40:07 $12 * $Revision: 1.16 $ $Name: not supported by cvs2svn $ 13 * $Date: 2008-04-13 08:18:27 $ 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 15 15 */ … … 54 54 #endif // ifdef DOXYGEN 55 55 56 /** Reports an abort message to logging facility 57 * 58 * This function will invoke the psLogMsg function with a level of 59 * PS_LOG_ABORT and pass the parameters name and fmt to generate a proper 60 * log message. After logging, this function will call system abort 61 * function to abnormally terminate the program. 62 * 63 * @return void No return value 64 * 65 */ 66 #ifdef DOXYGEN 67 void psAssert( 68 const bool value, 69 const char *format, ///< A printf style formatting statement 70 ... 71 ); 72 #else // ifdef DOXYGEN 73 void p_psAssert( 74 const char *file, ///< File of caller 75 unsigned int lineno, ///< Line number of caller 76 const char *func, ///< Function name of caller 77 const bool value, 78 const char *format, ///< A printf style formatting statement 79 ... 80 ) PS_ATTR_FORMAT(printf, 5, 6); 81 #ifndef SWIG 82 #define psAssert(VALUE, ...) \ 83 p_psAssert(__FILE__, __LINE__, __func__, (VALUE), __VA_ARGS__) 84 #endif // iddef SWIG 85 #endif // ifdef DOXYGEN 86 56 87 /// @} 57 88 #endif // #ifndef PS_ABORT_H
Note:
See TracChangeset
for help on using the changeset viewer.
