summaryrefslogtreecommitdiffstats
path: root/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-14 16:17:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-14 16:17:58 +0000
commit85e0c8135de3db530a4605f67235844babea1a01 (patch)
tree502437983ead917742e4427d2121b3e1f0dc3b50 /src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h
parentAdding debian version 3.3.5-1.1. (diff)
downloadknot-85e0c8135de3db530a4605f67235844babea1a01.tar.xz
knot-85e0c8135de3db530a4605f67235844babea1a01.zip
Merging upstream version 3.3.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h')
-rw-r--r--src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h b/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h
index 28d3461..8974c86 100644
--- a/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h
+++ b/src/contrib/libngtcp2/ngtcp2/lib/ngtcp2_macro.h
@@ -55,4 +55,40 @@
*/
#define ngtcp2_arraylen(A) (sizeof(A) / sizeof(A[0]))
+/*
+ * ngtcp2_max variants but they are inline functions. The
+ * intermediate values are stored in parameters so that they are
+ * evaluated just once.
+ */
+#define ngtcp2_max_def(SUFFIX, T) \
+ static inline T ngtcp2_max_##SUFFIX(T a, T b) { return a < b ? b : a; }
+
+ngtcp2_max_def(int8, int8_t);
+ngtcp2_max_def(int16, int16_t);
+ngtcp2_max_def(int32, int32_t);
+ngtcp2_max_def(int64, int64_t);
+ngtcp2_max_def(uint8, uint8_t);
+ngtcp2_max_def(uint16, uint16_t);
+ngtcp2_max_def(uint32, uint32_t);
+ngtcp2_max_def(uint64, uint64_t);
+ngtcp2_max_def(size, size_t);
+
+/*
+ * ngtcp2_min variants but they are inline functions. The
+ * intermediate values are stored in parameters so that they are
+ * evaluated just once.
+ */
+#define ngtcp2_min_def(SUFFIX, T) \
+ static inline T ngtcp2_min_##SUFFIX(T a, T b) { return a < b ? a : b; }
+
+ngtcp2_min_def(int8, int8_t);
+ngtcp2_min_def(int16, int16_t);
+ngtcp2_min_def(int32, int32_t);
+ngtcp2_min_def(int64, int64_t);
+ngtcp2_min_def(uint8, uint8_t);
+ngtcp2_min_def(uint16, uint16_t);
+ngtcp2_min_def(uint32, uint32_t);
+ngtcp2_min_def(uint64, uint64_t);
+ngtcp2_min_def(size, size_t);
+
#endif /* NGTCP2_MACRO_H */