This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
eh.h
51 lines (42 loc) · 1.6 KB
/
eh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/************************************************************************ *
* Goma - Multiphysics finite element software *
* Sandia National Laboratories *
* *
* Copyright (c) 2014 Sandia Corporation. *
* *
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, *
* the U.S. Government retains certain rights in this software. *
* *
* This software is distributed under the GNU General Public License. *
\************************************************************************/
/* eh -- macros for calling error handler */
#ifndef _EH_H
#define _EH_H
#ifdef EXTERN
#undef EXTERN
#endif
#ifdef _EH_C
#define EXTERN /* do nothing */
#endif
#ifndef _EH_C
#define EXTERN extern
#endif
EXTERN void eh
PROTO((const int , /* error_flag */
const char *, /* file */
const int , /* line */
const char *)); /* message */
/* This macro expands to a function call to the error handler eh() with
* four arguments:
* IERR -- an int, if IERR=-1 there is a problem
* MESSAGE -- a string, which gets printed if the
* error dump is activated by IERR=-1
*
* eh() finally exits with -1 if an error occurred.
*
* Intent:
* -------
* EH(return_code, "I am informative.");
*/
#define EH(IERR, MESSAGE) eh(IERR, __FILE__, __LINE__, MESSAGE)
#endif