summaryrefslogtreecommitdiffstats
path: root/src/H5Eprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r--src/H5Eprivate.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index e3319e5..0491439 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -30,16 +30,20 @@ typedef struct H5E_t H5E_t;
* error number, the minor error number, and a description of the error.
*/
#define HERROR(maj_id, min_id, ...) \
- H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__)
+ do { \
+ H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__); \
+ } while (0)
/*
* HCOMMON_ERROR macro, used by HDONE_ERROR and HGOTO_ERROR
* (Shouldn't need to be used outside this header file)
*/
#define HCOMMON_ERROR(maj, min, ...) \
- HERROR(maj, min, __VA_ARGS__); \
- err_occurred = TRUE; \
- err_occurred = err_occurred; /* Shut GCC warnings up! */
+ do { \
+ HERROR(maj, min, __VA_ARGS__); \
+ err_occurred = TRUE; \
+ err_occurred = err_occurred; /* Shut GCC warnings up! */ \
+ } while (0)
/*
* HDONE_ERROR macro, used to facilitate error reporting between a
@@ -51,10 +55,10 @@ typedef struct H5E_t H5E_t;
* without jumping to any labels)
*/
#define HDONE_ERROR(maj, min, ret_val, ...) \
- { \
+ do { \
HCOMMON_ERROR(maj, min, __VA_ARGS__); \
ret_value = ret_val; \
- }
+ } while (0)
/*
* HGOTO_ERROR macro, used to facilitate error reporting between a
@@ -74,11 +78,11 @@ typedef struct H5E_t H5E_t;
* H5_END_TAG statements. Resets the metadata tag before leaving the function.
*/
#define HGOTO_ERROR_TAG(maj, min, ret_val, ...) \
- { \
+ do { \
H5AC_tag(prv_tag, NULL); \
HCOMMON_ERROR(maj, min, __VA_ARGS__); \
HGOTO_DONE(ret_val); \
- }
+ } while (0)
/*
* HGOTO_DONE macro, used to facilitate normal return between a FUNC_ENTER()
@@ -97,10 +101,10 @@ typedef struct H5E_t H5E_t;
* H5_END_TAG statements. Resets the metadata tag before leaving the function.
*/
#define HGOTO_DONE_TAG(ret_val) \
- { \
+ do { \
H5AC_tag(prv_tag, NULL); \
HGOTO_DONE(ret_val); \
- }
+ } while (0)
/*
* Macros handling system error messages as described in C standard.