forked from Unidata/netcdf-c
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hdf5err.h
34 lines (27 loc) · 888 Bytes
/
hdf5err.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
/*********************************************************************
* Copyright 2018, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#ifndef HDF5ERR_H
#define HDF5ERR_H
#ifdef LOGGING
/* BAIL2 was moved here from nc_logging.h because
it invokes nc_log_hdf5, and so is HDF5 specific.
Also moved nc_log_hdf5 into hdf5internal.c
*/
/* To log based on error code, and set retval. */
/* Note that this can only be used in libhdf5 because of
the call to nc_log_hdf5 */
#define BAIL2(e) \
do { \
retval = e; \
LOG((0, "file %s, line %d.\n%s", __FILE__, __LINE__, nc_strerror(e))); \
nc_log_hdf5(); \
} while (0)
#else /* LOGGING */
#define BAIL2(e) \
do { \
retval = e; \
} while (0)
#endif /*LOGGING*/
#endif /*HDF5ERR_H*/