diff options
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/H5private.h b/src/H5private.h index 1fc944b..49437cc 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -421,11 +421,15 @@ extern char *strdup(const char *s); extern hbool_t library_initialize_g; /*good thing C's lazy about extern! */ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */ -#define PRINT(N,S) { \ +/* Print S on file N followed by a newline */ +#define H5_PRINT(N,S) { \ write ((N), (S), strlen((S))); \ write ((N), "\n", 1); \ } +/* Is `S' the name of an API function? */ +#define H5_IS_API(S) ('_'!=S[2] && '_'!=S[3] && (!S[4] || '_'!=S[4])) + #define FUNC_ENTER(func_name,err) FUNC_ENTER_INIT(func_name,INTERFACE_INIT,err) #define FUNC_ENTER_INIT(func_name,interface_init_func,err) { \ @@ -463,10 +467,9 @@ extern hbool_t thread_initialize_g; /*don't decl interface_initialize_g */ } \ \ /* Clear thread error stack entering public functions */ \ - if (H5E_clearable_g && '_'!=FUNC[2] && '_'!=FUNC[3] && \ - (!FUNC[4] || '_'!=FUNC[4])) { \ - PRINT (55, #func_name); \ - H5Eclear (H5E_thrdid_g); \ + if (H5E_clearable_g && H5_IS_API (FUNC)) { \ + H5_PRINT (55, #func_name); \ + H5E_clear (); \ } \ { |