IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 7, 2007, 1:52:54 PM (19 years ago)
Author:
jhoblitt
Message:

update psAbort() API:

add noreturn attribute
remove unneeded 'name' params
turn into a macro so file/line/func are automatiically passed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psAbort.h

    r11248 r11686  
    88 *
    99 *  @author Eric Van Alst, MHPCC
     10 *  @author Joshua Hoblitt, University of Hawaii
    1011 *
    11  *  $Revision: 1.13 $ $Name: not supported by cvs2svn $
    12  *  $Date: 2007-01-23 22:47:23 $
     12 *  $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  $Date: 2007-02-07 23:52:54 $
    1314 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1415 */
     
    1920/// @addtogroup SysUtils System Utilities
    2021/// @{
     22
     23#include <stdarg.h>
    2124
    2225/** Reports an abort message to logging facility
     
    3033 *
    3134 */
    32 #ifdef __GNUC__
     35#ifdef DOXYGEN
    3336void psAbort(
    34     const char *name,                  ///< Source of abort such as file or function detected
    35     const char *format,                   ///< A printf style formatting statement defining msg
    36     ...
    37 ) __attribute__((format(printf, 2, 3)));
    38 #else // __GNUC__
    39 void psAbort(
    40     const char *name,                  ///< Source of abort such as file or function detected
    41     const char *format,                   ///< A printf style formatting statement defining msg
     37    const char *format,                 ///< A printf style formatting statement
    4238    ...
    4339);
    44 #endif // __GNUC__
     40#else // ifdef DOXYGEN
     41void p_psAbort(
     42    const char *file,                   ///< File of caller
     43    unsigned int lineno,                ///< Line number of caller
     44    const char *func,                   ///< Function name of caller
     45    const char *format,                 ///< A printf style formatting statement
     46    ...
     47#ifdef __GNUC__
     48) __attribute__((format(printf, 4, 5), noreturn));
     49#else // ifdef __GNUC__
     50);
     51#endif // ifdef __GNUC__
     52#ifndef SWIG
     53#define psAbort(...) \
     54      p_psAbort(__FILE__, __LINE__, __func__, __VA_ARGS__)
     55#endif // iddef SWIG
     56#endif // ifdef DOXYGEN
    4557
    4658/// @}
Note: See TracChangeset for help on using the changeset viewer.