summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5tools_error.h
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-07-22 20:03:22 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-07-22 20:03:22 (GMT)
commit099c7242fbdf698cbb13339bfc71f38b8f363dfe (patch)
tree1ed51040cf41c16f2c55db79133ca86dfa0d3052 /tools/lib/h5tools_error.h
parent0ee5d676210291f784ce273ee34b1a7d383ec694 (diff)
downloadhdf5-099c7242fbdf698cbb13339bfc71f38b8f363dfe.zip
hdf5-099c7242fbdf698cbb13339bfc71f38b8f363dfe.tar.gz
hdf5-099c7242fbdf698cbb13339bfc71f38b8f363dfe.tar.bz2
Merge from dev of tools changes
Diffstat (limited to 'tools/lib/h5tools_error.h')
-rw-r--r--tools/lib/h5tools_error.h52
1 files changed, 27 insertions, 25 deletions
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index 4e2e935..764fb91 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -101,14 +101,16 @@ do {
* H5TOOLS_PUSH_ERROR macro, used to push an error to an error stack. Not meant to
* be called directly.
*/
-#define H5TOOLS_PUSH_ERROR(estack_id, err_cls, maj_err_id, min_err_id, ...) \
-do { \
- if (estack_id >= 0 && err_cls >= 0) \
- H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \
- else { \
- HDfprintf(stderr, __VA_ARGS__); \
- HDfprintf(stderr, "\n"); \
- } \
+#define H5TOOLS_PUSH_ERROR(estack_id, err_cls, maj_err_id, min_err_id, ...) \
+do { \
+ if (enable_error_stack > 0) { \
+ if (estack_id >= 0 && err_cls >= 0) \
+ H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \
+ else { \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ } \
+ } \
} while(0)
/*
@@ -167,30 +169,30 @@ do {
#ifdef H5_TOOLS_DEBUG
-#define H5TOOLS_START_DEBUG(...) \
-do { \
- H5tools_INDENT_g += 2; \
+#define H5TOOLS_START_DEBUG(...) \
+do { \
+ H5tools_INDENT_g += 2; \
HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
- HDfprintf(stderr, __VA_ARGS__); \
- HDfprintf(stderr, "\n"); \
- HDfflush(stderr); \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ HDfflush(stderr); \
} while(0)
-#define H5TOOLS_DEBUG(...) \
-do { \
+#define H5TOOLS_DEBUG(...) \
+do { \
HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
- HDfprintf(stderr, __VA_ARGS__); \
- HDfprintf(stderr, "\n"); \
- HDfflush(stderr); \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ HDfflush(stderr); \
} while(0)
-#define H5TOOLS_ENDDEBUG(...) \
-do { \
+#define H5TOOLS_ENDDEBUG(...) \
+do { \
HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
- HDfprintf(stderr, __VA_ARGS__); \
- HDfprintf(stderr, "\n"); \
- H5tools_INDENT_g -= 2; \
- HDfflush(stderr); \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ H5tools_INDENT_g -= 2; \
+ HDfflush(stderr); \
} while(0)
#else