summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h
index a82796e..7d15312 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -398,6 +398,11 @@
/* Raise an integer to a power of 2 */
#define H5_EXP2(n) (1 << (n))
+/* Check if a read of size bytes starting at ptr would overflow past
+ * the last valid byte, pointed to by buffer_end.
+ */
+#define H5_IS_BUFFER_OVERFLOW(ptr, size, buffer_end) (((ptr) + (size)-1) > (buffer_end))
+
/*
* HDF Boolean type.
*/