summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-04-14 14:05:40 (GMT)
committerGitHub <noreply@github.com>2022-04-14 14:05:40 (GMT)
commit3961f6500d8303ff03bdd8fb38b0edc618b128ab (patch)
treee5866d374dfb2151e58d1ec1a64e9449fe6be504 /src/H5private.h
parent1a1e59172dc6312808981baeca4bc1772e126ff3 (diff)
downloadhdf5-3961f6500d8303ff03bdd8fb38b0edc618b128ab.zip
hdf5-3961f6500d8303ff03bdd8fb38b0edc618b128ab.tar.gz
hdf5-3961f6500d8303ff03bdd8fb38b0edc618b128ab.tar.bz2
Hdf5 1 10 merges (#1633)
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/H5private.h b/src/H5private.h
index fbc78d2..ceea02a 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -2106,6 +2106,8 @@ H5_DLL herr_t H5CX_pop(void);
/* Push the API context */ \
if (H5CX_push() < 0) \
HGOTO_ERROR(H5E_FUNC, H5E_CANTSET, err, "can't set API context") \
+ else \
+ api_ctx_pushed = TRUE; \
\
BEGIN_MPE_LOG
@@ -2113,6 +2115,8 @@ H5_DLL herr_t H5CX_pop(void);
#define FUNC_ENTER_API(err) \
{ \
{ \
+ hbool_t api_ctx_pushed = FALSE; \
+ \
FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_INIT(err); \
FUNC_ENTER_API_PUSH(err); \
@@ -2127,6 +2131,8 @@ H5_DLL herr_t H5CX_pop(void);
#define FUNC_ENTER_API_NOCLEAR(err) \
{ \
{ \
+ hbool_t api_ctx_pushed = FALSE; \
+ \
FUNC_ENTER_API_COMMON \
FUNC_ENTER_API_INIT(err); \
FUNC_ENTER_API_PUSH(err); \
@@ -2353,14 +2359,17 @@ H5_DLL herr_t H5CX_pop(void);
H5_API_SET_CANCEL
#define FUNC_LEAVE_API_COMMON(ret_value) \
- ; \
- } /*end scope from end of FUNC_ENTER*/ \
FINISH_MPE_LOG \
H5TRACE_RETURN(ret_value);
#define FUNC_LEAVE_API(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
FUNC_LEAVE_API_COMMON(ret_value); \
- (void)H5CX_pop(); \
+ if (api_ctx_pushed) { \
+ (void)H5CX_pop(); \
+ api_ctx_pushed = FALSE; \
+ } \
H5_POP_FUNC \
if (err_occurred) \
(void)H5E_dump_api_stack(TRUE); \
@@ -2371,6 +2380,8 @@ H5_DLL herr_t H5CX_pop(void);
/* Use this macro to match the FUNC_ENTER_API_NOINIT macro */
#define FUNC_LEAVE_API_NOINIT(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
FUNC_LEAVE_API_COMMON(ret_value); \
H5_POP_FUNC \
if (err_occurred) \
@@ -2383,6 +2394,8 @@ H5_DLL herr_t H5CX_pop(void);
/* Use this macro to match the FUNC_ENTER_API_NOINIT_NOERR_NOFS macro */
#define FUNC_LEAVE_API_NOFS(ret_value) \
+ ; \
+ } /*end scope from end of FUNC_ENTER*/ \
FUNC_LEAVE_API_COMMON(ret_value); \
FUNC_LEAVE_API_THREADSAFE \
return (ret_value); \