diff options
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r-- | src/H5Eprivate.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 9c5744f..c5c546a 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -118,6 +118,26 @@ H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); +/* + * Macros handling system error messages as described in C standard. + * These macros assume errnum is a valid system error code. + */ + +/* Retrieve the error code description string and push it onto the error + * stack. + */ +#define HSYS_ERROR(errnum){ \ + HERROR(H5E_INTERNAL, H5E_SYSERRSTR, strerror(errnum)); \ +} +#define HSYS_DONE_ERROR(majorcode, minorcode, retcode, str){ \ + HSYS_ERROR(errno); \ + HDONE_ERROR(majorcode, minorcode, retcode, str); \ +} +#define HSYS_GOTO_ERROR(majorcode, minorcode, retcode, str){ \ + HSYS_ERROR(errno); \ + HGOTO_ERROR(majorcode, minorcode, retcode, str); \ +} + #ifdef H5_HAVE_PARALLEL /* * MPI error handling macros. |