From cb955cc15e4761f0b9ad16c29499a4077f3b49ef Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 28 Oct 2024 08:23:41 -0700 Subject: [PATCH] Initial cleanup of "prep" macros --- src/H5private.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index 7fa2cc453c0..1911d764ffe 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1184,26 +1184,32 @@ extern char H5_lib_vers_info_g[]; /* ---------------------------------------------------------------------------- * Macros that set things up upon entering an HDF5 API call - * ---------------------------------------------------------------------------- + * ---------------------------------------------------------------------------- */ +/* clang-format off */ + #define FUNC_ENTER_COMMON(asrt) \ bool err_occurred = false; \ \ FUNC_ENTER_CHECK_NAME(asrt); -#define FUNC_ENTER_COMMON_NOERR(asrt) FUNC_ENTER_CHECK_NAME(asrt); +#define FUNC_ENTER_COMMON_NOERR(asrt) \ + FUNC_ENTER_CHECK_NAME(asrt); + +/* Entry setup for public API call variables */ +#define FUNC_ENTER_API_VARS \ + H5CANCEL_DECL /* thread cancellation */ -/* Local variables for API routines */ -#define FUNC_ENTER_API_VARS H5CANCEL_DECL +/* clang-format on */ #define FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_VARS \ FUNC_ENTER_COMMON(H5_IS_API(__func__)); \ H5_API_LOCK +/* Macro to initialize the library, if some other package hasn't already done that */ #define FUNC_ENTER_API_INIT(err) \ - /* Initialize the library */ \ if (H5_UNLIKELY(!H5_INIT_GLOBAL && !H5_TERM_GLOBAL)) \ if (H5_UNLIKELY(H5_init_library() < 0)) \ HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, "library initialization failed"); \