diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2003-09-29 16:23:15 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2003-09-29 16:23:15 (GMT) |
commit | b997db6cdd5911e475cd50c06cdbf448fd40c9eb (patch) | |
tree | c2d2d3cd8192072c524e817399e03f161b66dd06 /src | |
parent | 53b34b2e9616805b93ef54c6d40cb742d4238e3b (diff) | |
download | hdf5-b997db6cdd5911e475cd50c06cdbf448fd40c9eb.zip hdf5-b997db6cdd5911e475cd50c06cdbf448fd40c9eb.tar.gz hdf5-b997db6cdd5911e475cd50c06cdbf448fd40c9eb.tar.bz2 |
[svn-r7519] Purpose:
Description: add backward compatibility for thread safety.
Platforms tested: RH 8(fuss)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5E.c | 9 | ||||
-rw-r--r-- | src/H5Epublic.h | 4 |
2 files changed, 10 insertions, 3 deletions
@@ -279,7 +279,7 @@ H5E_get_stack(void) /* no associated value with current thread - create one */ estack = (H5E_t *)H5MM_malloc(sizeof(H5E_t)); estack->nused = 0; - estack->func = H5Eprint; + estack->func = (H5E_auto_t)H5Eprint; estack->auto_data = NULL; pthread_setspecific(H5TS_errstk_key_g, (void *)estack); } @@ -2190,7 +2190,6 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) #ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- - * Function: H5Eget_auto * * Purpose: This function is for backward compatbility. * Returns the current settings for the automatic error stack @@ -2227,8 +2226,8 @@ H5Eget_auto(H5E_auto_t *func, void **client_data) done: FUNC_LEAVE_API(ret_value) } - #else + /*------------------------------------------------------------------------- * Function: H5Eget_auto @@ -2490,7 +2489,11 @@ H5E_dump_api_stack(int is_api) assert(estack); if (estack->func) +#ifdef H5_WANT_H5_V1_6_COMPAT + (void)((estack->func)(estack->auto_data)); +#else /*H5_WANT_H5_V1_6_COMPAT*/ (void)((estack->func)(H5E_DEFAULT, estack->auto_data)); +#endif /* H5_WANT_H5_V1_6_COMPAT */ } /* end if */ done: diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 99fccd8..49da51e 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -158,7 +158,11 @@ extern "C" { /* Error stack traversal callback function pointers */ typedef herr_t (*H5E_walk_t)(unsigned n, const H5E_error_t *err_desc, void *client_data); +#ifdef H5_WANT_H5_V1_6_COMPAT +typedef herr_t (*H5E_auto_t)(void *client_data); +#else typedef herr_t (*H5E_auto_t)(hid_t estack, void *client_data); +#endif /* H5_WANT_H5_V1_6_COMPAT */ /* Public API functions */ H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version); |