diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-11-10 17:30:09 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-11-10 17:30:09 (GMT) |
commit | 37358db8ab62fa9c9057ea118b8576d5a4368ef1 (patch) | |
tree | a1290bfece5213bedc47eb9a0817ef19f5c9ea9b /src/H5Eprivate.h | |
parent | fbd4cf9bfea5418e2e4e2b81f31459db4aae4d61 (diff) | |
download | hdf5-37358db8ab62fa9c9057ea118b8576d5a4368ef1.zip hdf5-37358db8ab62fa9c9057ea118b8576d5a4368ef1.tar.gz hdf5-37358db8ab62fa9c9057ea118b8576d5a4368ef1.tar.bz2 |
[svn-r17862] Description:
Bring r17860 from trunk to 1.8 branch:
"Normalize" object names for external links, making them into the same
form as used for soft links.
Begin the process of adding more printf-like information to library
error reporting. HGOTO_ERROR() and HDONE_ERROR() macros can now use the last
parameter (a string) like a printf() formatting string and pass extra
parameters with additional information. (For example, see the HGOTO_ERROR
macros in H5FD_sec2_read() in src/H5FDsec2.c)
Bring the underlying H5E_printf_stack() routine from trunk to 1.8
branch also.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r-- | src/H5Eprivate.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 6b1c80c..42f2e9c 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -32,14 +32,14 @@ typedef struct H5E_t H5E_t; * and a FUNC_LEAVE() within a function body. The arguments are the major * error number, the minor error number, and a description of the error. */ -#define HERROR(maj_id, min_id, str) H5E_push_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, str) +#define HERROR(maj_id, min_id, ...) H5E_printf_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__) /* * 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, str) \ - HERROR(maj, min, str); \ +#define HCOMMON_ERROR(maj, min, ...) \ + HERROR(maj, min, __VA_ARGS__); \ err_occurred = TRUE; /* @@ -51,8 +51,8 @@ typedef struct H5E_t H5E_t; * (This macro can also be used to push an error and set the return value * without jumping to any labels) */ -#define HDONE_ERROR(maj, min, ret_val, str) { \ - HCOMMON_ERROR(maj, min, str); \ +#define HDONE_ERROR(maj, min, ret_val, ...) { \ + HCOMMON_ERROR(maj, min, __VA_ARGS__); \ ret_value = ret_val; \ } @@ -63,8 +63,8 @@ typedef struct H5E_t H5E_t; * error string. The return value is assigned to a variable `ret_value' and * control branches to the `done' label. */ -#define HGOTO_ERROR(maj, min, ret_val, str) { \ - HCOMMON_ERROR(maj, min, str); \ +#define HGOTO_ERROR(maj, min, ret_val, ...) { \ + HCOMMON_ERROR(maj, min, __VA_ARGS__); \ HGOTO_DONE(ret_val) \ } @@ -78,8 +78,10 @@ typedef struct H5E_t H5E_t; /* Library-private functions defined in H5E package */ H5_DLL herr_t H5E_init(void); -H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, - hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); +H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, + unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); +H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, + unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); |