summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 91a4780..327e2c9 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -413,6 +413,35 @@
*/
#define H5_REQUEST_NULL NULL
+/* clang-format off */
+/* Address-related macros */
+#define H5_addr_overflow(X,Z) (HADDR_UNDEF == (X) || \
+ HADDR_UNDEF == (X) + (haddr_t)(Z) || \
+ (X) + (haddr_t)(Z) < (X))
+#define H5_addr_defined(X) ((X) != HADDR_UNDEF)
+/* The H5_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making
+ * certain that X is not HADDR_UNDEF and then checking that X equals Y
+ */
+#define H5_addr_eq(X,Y) ((X) != HADDR_UNDEF && (X) == (Y))
+#define H5_addr_ne(X,Y) (!H5_addr_eq((X),(Y)))
+#define H5_addr_lt(X,Y) ((X) != HADDR_UNDEF && \
+ (Y) != HADDR_UNDEF && \
+ (X) < (Y))
+#define H5_addr_le(X,Y) ((X) != HADDR_UNDEF && \
+ (Y) != HADDR_UNDEF && \
+ (X) <= (Y))
+#define H5_addr_gt(X,Y) ((X) != HADDR_UNDEF && \
+ (Y) != HADDR_UNDEF && \
+ (X) > (Y))
+#define H5_addr_ge(X,Y) ((X) != HADDR_UNDEF && \
+ (Y) != HADDR_UNDEF && \
+ (X) >= (Y))
+#define H5_addr_cmp(X,Y) (H5_addr_eq((X), (Y)) ? 0 : \
+ (H5_addr_lt((X), (Y)) ? -1 : 1))
+#define H5_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \
+ ((O1) >= (O2) && (O1) < ((O2) + (L2))))
+/* clang-format on */
+
/*
* Methods to compare the equality of floating-point values:
*