Mercury
mchecksum_error.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Argonne National Laboratory, Department of Energy,
3  *                    UChicago Argonne, LLC and The HDF Group.
4  * All rights reserved.
5  *
6  * The full copyright notice, including terms governing use, modification,
7  * and redistribution, is contained in the COPYING file that can be
8  * found at the root of the source code distribution tree.
9  */
10 
11 #ifndef MCHECKSUM_ERROR_H
12 #define MCHECKSUM_ERROR_H
13 
14 #include "mchecksum_config.h"
15 
16 #define MCHECKSUM_SUCCESS 1
17 #define MCHECKSUM_FAIL -1
18 #define MCHECKSUM_TRUE 1
19 #define MCHECKSUM_FALSE 0
20 
21 /* For compatibility */
22 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ < 199901L)
23  #if defined(__GNUC__) && (__GNUC__ >= 2)
24  #define __func__ __FUNCTION__
25  #else
26  #define __func__ "<unknown>"
27  #endif
28 #elif defined(_WIN32)
29  #define __func__ __FUNCTION__
30 #endif
31 
32 /* Default error macro */
33 #ifdef MCHECKSUM_HAVE_VERBOSE_ERROR
34  #include <stdio.h>
35  #define MCHECKSUM_ERROR_DEFAULT(x) { \
36  fprintf(stderr, "Error " \
37  "in %s:%d (%s): " \
38  "%s.\n", \
39  __FILE__, __LINE__, __func__, x); \
40  }
41 #else
42  #define MCHECKSUM_ERROR_DEFAULT(x)
43 #endif
44 
45 #endif /* MCHECKSUM_ERROR_H */