If MAX/MIN are defined in system headers, undefine them first.
&sample_time,
offset, delay, dispersion,
root_delay, root_dispersion,
- message->stratum > inst->min_stratum ?
- message->stratum : inst->min_stratum,
+ MAX(message->stratum, inst->min_stratum),
(NTP_Leap) pkt_leap);
SRC_SelectSource(inst->source);
/* Fill buffer with random bytes */
extern void UTI_GetRandomBytes(void *buf, unsigned int len);
+/* Macros to get maximum and minimum of two values */
+#ifdef MAX
+#undef MAX
+#endif
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
+
+/* Macro to clamp a value between two values */
+#define CLAMP(min, x, max) (MAX((min), MIN((x), (max))))
+
#endif /* GOT_UTIL_H */